PDA

View Full Version : How handle onClick on checkcolumn of Ext.grid.plugin.RowEditing?



re.tf
24 Feb 2013, 3:25 PM
Hi all,

I have one grid “RowEditing”! In this grid I have one checkcolumn!

I want know how to handle OnClick on this checkcolumn! When user click in checkbox of checkcolumn I want receive current grid record, and if checkbox is checked or not, then I will send an ajax request!

How I can handle this?

My code:

var grid = Ext.create('Ext.grid.Panel', {
width: 955,
height: 300,
enableColumnHide: false,
store: store,
disableSelection: true,
columns:[
/* MY CHECK*/
{
xtype: 'checkcolumn',
header: 'Track?',
dataIndex: 'track_status',
renderStatus: renderCheck,
width: 60,
handler : function(){alert('test')},
editor: {
xtype: 'checkbox',
cls: 'x-grid-checkheader-editor'
}
} // ... Other cols
],
listeners : {
validateedit: function(editor, e, eOpts) {
// ...
}

},
// paging bar on the bottom
bbar: Ext.create('Ext.PagingToolbar', {
store: store,
displayInfo: true,
displayMsg: {0} - {1} de {2}',
emptyMsg: "Nenhum "
}),
renderTo: 'gridAnchor',
plugins: [rowEditing],
});
Thanks;)

wojteks27
25 Feb 2013, 5:22 AM
Have you tried using this event :

checkchange (http://docs.sencha.com/ext-js/4-0/#!/api/Ext.ux.CheckColumn-event-checkchange)( this, rowIndex, checked, eOpts )?3
Fires when the checked state of a row changes ...

??

In the docs there is also an example for ExtJS 4.1.1 :



{ xtype:'checkcolumn',text:'',dataIndex:'done',width:40,sortable:false, listeners:{ checkchange:function(cc,ix,isChecked){ alert(isChecked);}}}


Try it, maybe it'll work:)

re.tf
26 Feb 2013, 3:47 AM
thanks, work!