View Full Version : CheckboxModel deselection difference

18 Oct 2012, 6:09 AM
I have a grid with Ext.selection.CheckboxModel.

extend: 'Ext.grid.Panel',
store: Ext.create('MyStore'),
columns: [{
header: 'Code',
dataIndex: 'Code'
header: 'Name',
dataIndex: 'Name'
initComponent: function(){
this.selModel = Ext.create("Ext.selection.CheckboxModel",{
checkOnly : true,
listeners: {
select: function(row, record, index, eOpts){
deselect: function(row, record, index, eOpts){

I have to make some actions when user selects or deselects some record in this grid. In some cases the store for this grid is reloading. In ExtJS 4.1.1 before store is loaded there happens deselection of all selected item that makes deselect event for Checkboxmodel fired. But I just want to process user selection\deselection. How can I distinguish deselection via store reloading and user deselection? Thanks!

18 Oct 2012, 7:08 AM
I couldn't quite figure out what are you saying but pruneRemoved (http://docs.sencha.com/ext-js/4-1/#!/api/Ext.selection.Model-cfg-pruneRemoved) might be of some help maybe.

19 Oct 2012, 5:33 AM
I found the solution. In order to prevent deselecting all selected rows in grid with CheckboxModel when store is reloading, before store loading there should be done store.removeAll(). After this you can use store.load(). Deselect event isn't fired.