PDA

View Full Version : [CLOSED] GridPanel CheckAll functionality



shaileshsakaria
Apr 03, 2013, 1:47 PM
Hi,

I have used GridPanel with CheckColumn with local PageToolbar with PageSize = 20.

I have binded store with 1200 record in page_load.

Now I want to apply checkall functionality of all store's record. but it checks only 20 records.

Code For Check All functionality is given below and I have wirten in CheckColumn's AfterRenderer.


this.el.on('click', function (e, el) {for (i = 0; i < #{StoreSearchResult}.getRange().length; i++) {#{StoreSearchResult}.getAt(i).set('chk',#{chkSele ctAll}.checked)} #{GridSearchResult}.view.refresh();avgRapRateAll() ;});


Thanks
Shailesh

Daniil
Apr 03, 2013, 3:12 PM
Hi Shailesh,

Do you use remote or local paging?

shaileshsakaria
Apr 03, 2013, 3:32 PM
Hi Daniil,

I am using local paging..

Thanks
Shailesh

Daniil
Apr 03, 2013, 5:24 PM
OK. I think it is possible, but not easy.

Override the onHeaderClick function to select/deselect all the records.
http://docs.sencha.com/ext-js/4-2/#!/api/Ext.selection.CheckboxModel-method-onHeaderClick

Here is an example of how to select records from a non-current page.
http://forums.ext.net/showthread.php?21368#post92552

You should iterate all the Store's records.

Store1.allData
and populate a "selectedData" (see the example) object with all the ids.

Hope this helps.