PDA

View Full Version : The grid getSelectionModel().clearSelections() does not clear the select all checkbox



ireality
23 Oct 2012, 6:15 AM
I have an app where the grid view use a check-box selector. If I select all rows with the select all check box at the top of the screen then run the clearSelections() on the grid all the lines in the grid is un-selected, but the select all button is still selected. The button is un-selected as soon as as any line is selected, but my client is now stuck on this being an C error that needs to be fixed.

Am I doing something wrong or is there a work-around I can use?

Edit:
I added a dirty hack for now but would like to get a clean fix.
What I did was:
var el = Ext.get("gridcolumn-1031");
el.removeCls('x-grid-hd-checker-on');

mitchellsimoens
23 Oct 2012, 8:34 AM
Is this an Ext JS 4 question?

ireality
23 Oct 2012, 1:27 PM
Yes. I see now I was a little quick in selecting a forum. =) I assume the post should have been made under ExtJS4 bugs or similar?

evant
23 Oct 2012, 1:43 PM
This isn't a bug. It's marked as a private method. Also, if you read the comments for it:



A fast reset of the selections without firing events, updating the ui, etc.

ireality
24 Oct 2012, 1:36 AM
Is there then another function that should be run instead to achieve the desired result of clearing the selection and all checkboxes?

Barzoy
24 Oct 2012, 4:09 AM
Is there then another function that should be run instead to achieve the desired result of clearing the selection and all checkboxes?

Here it is (http://docs.sencha.com/ext-js/4-1/#!/api/Ext.selection.CheckboxModel-method-toggleUiHeader)