JasonYates.co.uk

ExtJS CheckboxSelectionModel clear header

A known issue with the ExtJS CheckboxSelectionModel is that when the grid is reloaded (e.g. an AJAX command is ran to delete selected rows) the header checkbox remains checked.

A solution to the issue is to override the clearSelections function to force the header to be unchecked.

Ext.override(Ext.grid.CheckboxSelectionModel, {

 clearSelections : Ext.grid.CheckboxSelectionModel.

         prototype.clearSelections.createSequence(function(fast){

 var hdCheckbox = this.grid.getEl().select(‘.x-grid3-hd-checker-on’);

      if(hdCheckbox) hdCheckbox.removeClass(‘x-grid3-hd-checker-on’);

  })

});


To Tumblr, Love PixelUnion

We're updating Fluid!

Soon, we'll be updating the look and feel of this theme. Read about the changes here. You can easily turn off this notification in the theme customization panel.

Close