PDA

View Full Version : Extjs 3.4 Editable Grid



shivam24
26 Feb 2013, 10:56 PM
Hello Every one, I'm New In ExtJS and try editable grid from docs. But I'm Unable to do that, I want to do without json. please can any one help me out from that?:(

sword-it
28 Feb 2013, 2:42 AM
Hi shivam,

Try the following code -



var editorGrid = new Ext.grid.EditorGridPanel(
{ border: true
, editable: true
, clicksToEdit: 1
, initComponent: function () {
this.store = this.store || this.createStore();
this.colModel = this.createColumns();
}
, createStore: function () {
return new Ext.data.JsonStore({
data : {}
, fields: ['coip_n', 'pp', 'com']
});
}
, createColumns: function () {
return new Ext.grid.ColumnModel({
defaults: {
resizable: true
},
columns: [
{
header: 'Name',
dataIndex: 'coip_n',
editor: {
xtype:'textfield'
, name:'Name'
}
},
{
header: 'Company',
dataIndex: 'com',
editor: {
xtype:'textfield'
, name:'Company'
}
},
{
header: 'Phone',
dataIndex: 'pp',
editor: {
xtype:'textfield'
, name:'Phone'
}
}
]
});
}
);