1
votes

I am new to EXTJS. I have a grid , where I have checkbox column . What I wanted is , how to capture the check or uncheck events happening in the checkbox .

Here is my code for checkbox in my grid

    columns : [

             {
            xtype: 'checkcolumn',
                   header: 'Enabled',
              dataIndex: 'isEnabled',
              width: 55
           },
        ....
         ]

Please help

2

2 Answers

2
votes

Just what Evan Trimboli said, with the checkchange event on the grid you can capture when a checkbox changes value.

Ext.create('Ext.grid.Panel', {
    //...
    columns  : [{ 
        xtype: 'checkcolumn',
        header: 'Enabled',
        dataIndex: 'isEnabled',
        width: 55,
        listeners: {
            checkchange: function(column, rowIdx, checked, eOpts){
                //Logic here
            }
        }
    }],
});
1
votes

There is a little change in the give answer, the checkchange event is for Ext.grid.column.check not for Ext.grid.Panel

Ext.create('Ext.grid.Panel', {
//...
columns  : [{ 
    xtype: 'checkcolumn',
    header: 'Enabled',
    dataIndex: 'isEnabled',
    width: 55,
    listeners: {
        checkchange: function(column, rowIdx, checked, eOpts){
            //Logic here
    }
    }
}]
});