I have a grid:
Ext.create('Ext.grid.Panel', {
id: 'grid',
store: this.store,
columns: [{
dataIndex: 'a'
},{
dataIndex: 'b'
},{
dataIndex: 'c'
}],
selModel: {
selType: 'cellmodel'
},
plugins: [cellEditing]
})
Which uses cellEditting:
var cellEditing = Ext.create('Ext.grid.plugin.CellEditing', {
clicksToEdit: 1,
listeners: {
beforeedit: function(obj) {
// Something goes here?
}
}
});
Now, there are buttons to 'add row' to the grid, so records may be new or old.
- In the case that a new row was added to the store/panel, I need columns
bandcto be editable. - In the case that the user is trying to edit an existing row that was simply loaded from the database when the panel was created, I need only column
cto be editable.
I suspect I need to add something to the beforeedit listener, but I am new to ExtJS and javascript in general so I don't know how to describe the conditions.