-
10 Jun 2011 7:18 AM #1
ExtJS 4.1.0 suppressEvent is not respected in CheckboxModel.onSelectChange
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.
I overrode the checkbox model adding the missing param where need and now things work as expected.Code:store.on('beforeload', function(store, operation, options) { // Clear all the grid selections and suppress the deselect event. this.getSelectionModel().deselectAll(true); })
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); } })Last edited by gordonk66; 10 Jun 2011 at 9:40 AM. Reason: Issue has been fixed
-
10 Jun 2011 9:29 AM #2
Please retest with 4.0.2 released today - not sure if this was something in the list of 200+ bug fixes.
Tim Ryan
Read BEFORE posting a question / BEFORE posting a Bug
Use Google to Search - API / Forum
API Doc (4.x | 3.x | 2.x | 1.x) / FAQ / 1.x->2.x Migration Guide / 2.x->3.x Migration Guide
-
10 Jun 2011 9:35 AM #3
I just took a look at the source and the fix is included.
Thanks.
-
10 Oct 2011 6:17 AM #4
In ext 4.0.6 issue is not totaly fixed.
IMHO the pb come frome the variable name and it's description
In "select" method :In "selectAll" method :suppressEvent : Boolean (optional)
Set to false to not fire a select eventWich is the excat opposite although both methods callsuppressEvent : Boolean
True to suppress any select events
this.doSelect(..., ..., suppressEvent);
-
5 Jan 2012 7:25 AM #5
Checked against Ext 4.1 and issue seems to be always be present ...
-
31 Aug 2012 6:07 AM #6Ext JS Premium Member
- Join Date
- Jan 2010
- Location
- Rotterdam, The Netherlands
- Posts
- 383
- Vote Rating
- 8
You guys only fixed it for select method. suppressEvent is ignored with selectAll.
I just tested it in 4.1.1.
Use this override until it's fixed by the Sencha devs. It's a copy paste of the original selectAll with the fix in red.
Code:Ext.override(Ext.selection.Model, { selectAll: function(suppressEvent) { var me = this, selections = me.store.getRange(), i = 0, len = selections.length, start = me.getSelection().length; me.bulkChange = true; for (; i < len; i++) { me.doSelect(selections[i], true, suppressEvent); } delete me.bulkChange; // fire selection change only if the number of selections differs me.maybeFireSelectionChange(me.getSelection().length !== start && !suppressEvent); } });
-
15 Nov 2012 3:14 AM #7Ext JS Premium Member
- Join Date
- Jan 2010
- Location
- Rotterdam, The Netherlands
- Posts
- 383
- Vote Rating
- 8
I think I understand what's happening. ExtJS devs probably intended to only suppress select en deselect events with suppressEvent=true. I _thought_ it would also suppress selectionchange event, but that just probably was never the intention of the ExtJS devs.
So, this might by not a bug, but ambiguous at least. However, if you wish to _also_ suppress the selectionchange event, use the override as described above.
(Note that deselectAll also needs the same in && !suppressEvent in the last line if you wish to suppress the selectionchange there)Christiaan Westerbeek @ Devotis
STOIC ninja, Ext JS expert, Google Apps reseller, Marketing technologist
-
5 Dec 2012 9:52 PM #8
Hi,
I reported the issue with selectionchange suppressing.
http://www.sencha.com/forum/showthread.php?250836
I also expect it should be suppressed.
Success! Looks like we've fixed this one. According to our records the fix was applied for
a bug in our system
in
a recent build.


Reply With Quote