PDA

View Full Version : grid edition and checkbox



fvinson
22 Jun 2012, 5:27 AM
Hi,
I have a grid panel with editing plugin ;
I want to have information when the user change data in the grid
It's ok when column are text but when the column is checkbox I don't have the information when the user click and change

Grid with Edition :


var cellEditing = Ext.create('Ext.grid.plugin.CellEditing', {
clicksToEdit: 1
});
var gridReaction = Ext.create('Ext.grid.Panel', {
store: storeReaction,
title: 'Reactions',
...
columns: [{ {
text : 'test',
flex : 1,
sortable : true,
dataIndex: 'name',
editor: {
allowBlank: false
},
},
{
text : 'hole',
width : 100,
xtype : 'checkcolumn',
sortable : true,
dataIndex: 'hole',
editor: {
xtype: 'checkbox',
cls: 'x-grid-checkheader-editor'
},
},

],
height: 350,
width: 600,
plugins: [cellEditing],
dockedItems: [{
xtype: 'toolbar',
items: [
DelReaction, ModifReaction
]
}],
viewConfig: {
stripeRows: true,
enableTextSelection: true
}
});

// Event when the user change data :[/U]\
gridReaction.on('edit', function(editor,e){
alert("field : "+e.field+" oldvalue : "+e.originalValue+" newvalue : "+e.value);
});

scottmartin
26 Jun 2012, 5:51 PM
You should be able to place a listener on your checkcolumn using checkchange(col,row,checked)

Scott.