ExtJS 4.1.0 suppressEvent is not respected in CheckboxModel.onSelectChange
Edit: Fixed in 4.0.2
The onSelectChange function in the checkbox model class needs to be updated to include the third parameter suppressEvent.
I found this when listening to the beforeload event of a grid store that has a checkbox selection model.
Code:
store.on('beforeload', function(store, operation, options) {
// Clear all the grid selections and suppress the deselect event.
this.getSelectionModel().deselectAll(true);
})
I overrode the checkbox model adding the missing param where need and now things work as expected.
Code:
Ext.require( [
'Ext.selection.CheckboxModel'
]);
Ext.selection.CheckboxModel.override( {
/**
* Synchronize header checker value as selection changes.
* @private
*/
onSelectChange: function(record, isSelected, suppressEvent) {
this.callParent([record, isSelected, suppressEvent]);
// check to see if all records are selected
var hdSelectStatus = this.selected.getCount() === this.store.getCount();
this.toggleUiHeader(hdSelectStatus);
}
})