-
5 Dec 2012 9:45 PM #1
[4.1.3] Selection model selectAll suppressEvent doesn't suppress selectionchange
[4.1.3] Selection model selectAll suppressEvent doesn't suppress selectionchange
REQUIRED INFORMATION
Ext version tested:- Ext 4.1.3
- Chrome
- IE9
- <!DOCTYPE html>
- The selection model's selectAll and deselectAll methods' suppressEvent option doesn't suppress the selectionchange event. I would expect it to be suppressed according the "True to suppress any select events" phrase in the docs. Or do you not consider the selectionchange event to meet the "any select (and deselect) events"?
- Please note that the selectionchange event fires just once if the suppressEvent option is true, but without that option it fires for each row.
- Here is a related thread with a possible fix.
- Also a selectAll call selects the last row. It looks buggy.
- Click the "Select all" button
- Click the "Deselect all" button
- The selectionchange event does not fire
- No selection after clicking the "Select all" button
- The selectionchange event does fire
- The last row is selected after clicking the "Select all" button
Code:<!DOCTYPE html> <html> <head> <title>selectAll suppressEvent</title> <link type="text/css" rel="stylesheet" href="../resources/css/ext-all.css" /> <script type="text/javascript" src="../ext-all-debug.js"></script> <script type="text/javascript"> Ext.onReady(function () { var grid = Ext.create("Ext.grid.Panel", { renderTo: Ext.getBody(), store: { autoLoad: true, fields: [{ name: "test" }], proxy: { type: "memory", data: [ ["test1"], ["test2"], ["test3"] ], reader: { type: "array" } } }, columns: { items: [{ dataIndex: "test", text: "Test" }] }, selModel: sm = Ext.create("Ext.selection.RowModel", { selType: "rowmodel", listeners: { selectionchange: { fn: function () { console.log('selectionchange'); } } } }) }); Ext.create("Ext.button.Button", { renderTo: Ext.getBody(), handler: function () { sm.selectAll(true); }, text: "Select all" }); Ext.create("Ext.button.Button", { renderTo: Ext.getBody(), handler: function () { sm.deselectAll(true); }, text: "Deselect all" }); }); </script> </head> <body> </body> </html>
-
6 Dec 2012 8:12 AM #2Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 33,654
- Vote Rating
- 434
Thanks for the report! I have opened a bug in our bug tracker.
You found a bug! We've classified it as
EXTJSIV-7933
.
We encourage you to continue the discussion and to find an acceptable workaround while we work on a permanent fix.


Reply With Quote