View Full Version : select/deselect all functionality in the grid too slow.

24 Sep 2014, 1:11 PM
Hello all,
I do a search on my page and get a list of results. When I click in the grid and click ctrl + A, all the records in the grid should get selected. For this I am using the following code.

{ key: Ext.EventObject.A,
ctrl: true,
fn: Ext.bind(this.doSelectAll, this),
defaultEventAction: "preventDefault"

doSelectAll: function(keyCode, event) {
var grid = this.view;
setTimeout(function() { grid.getView().scrollBy(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,false); }, 0.0); grid.getView().focusRow(0);

I don't have any issue with the select all functionality. But when I click ctrl + A and all the records get selected, If I try to click on one of those selected records, its taking huge time to deselect all the records and select the one particular record that I click. Like say If I have 20 records in my grid, If I say ctrl + A in the grid, all the 20 records get selected. Now if I click on one particular record, say the first record in the grid, it takes 1-2 seconds to deselect all the records and select the first record. If I have 100 records, its almost taking 8-10 seconds to deselect and select process. The maximum records I can show in my grid is 300 and to deselect and select one particular record, its taking almost 15-18 seconds. If I try to click somewhere in the grid during this process, I am getting script error and it asks me whether to stop the script or continue. This is happening in Firefox and IE as well. Not sure If I am doing something wrong or am I missing something. Any ideas?...

1 Oct 2014, 10:32 PM

I'd be happy to test this along with you. Can you post a working test case either inline here or at https://fiddle.sencha.com?

Also, what version of ExtJS are you working with where you're seeing the issue?