How to clear the store and update a paging toolbar?

jack.cap.rooney picture jack.cap.rooney · Sep 15, 2011 · Viewed 24.5k times · Source

i need to reset paging toolbar parameters as "page", "start", "limit" when i click on a search button to re-load grid store with different parametres!

how can i do it?

the problem is that when i am on the next page, and i do a new search, i have the parameters page=2, start=25, limit=25 dirty, instead i need to reset this parametres.

my code:

listeners: {
    click: function(){
        Ext.getCmp('GrlGio').getStore().removeAll();
        Ext.getCmp('GrlGio').store.load({
                params:{
                  mode: "RIC",
                  DataRicerca: dd,
                  Pit: Ext.getCmp('cmbPiattaforma').getValue()
                }
        });
    }
 }

thanks!

Answer

XåpplI'-I0llwlg'I  - picture XåpplI'-I0llwlg'I - · Jan 31, 2013

In Ext 4, I found loadPage() worked pretty well for resetting the data store and making the paging toolbar go back to the first page. Example:

store.loadPage(1) // note: 1-based, not 0-based