PDA

View Full Version : grid paging reset?



zlevardy
21 Sep 2012, 7:18 AM
hi,

i am using a store to do my search needs with extraParams. It works fine. Until i do a store.load() after set proxy.extraParams, and the paging toolbar gets confused. It shows earlier search result. For example first search found 4 pages of items, next one only 2. And I was on page 3 when close results windows, then new search will show something (i guess page 1), but the toolbar is "3" as we should be on page 3, no next, no prev works.

how can I reset paging toolbar after finished search? or how can i set store to defaults and get the reflected on paging toolbar?

many thx

zlevardy
23 Sep 2012, 11:25 PM
solution found here: http://www.szabogabor.net/2012/06/03/quicktip-gridpager-reset/



store.loadRecords([]); //set totalCount to zero

pager.onLoad(); //refresh paging toolbar

cu

harryrowell
28 Feb 2013, 9:49 AM
From another thread, I was pleasantly surprised to discover that you do NOT need to reset the pager directly.

I simply called removeAll and reset the page to 1 before calling load like this:


store.removeAll();
store.currentPage = 1;

store.load();

and the pager began working exactly as it should.

jpeckham
11 Mar 2015, 6:35 AM
I know this is an old post that I stumbled across, but you can simply do store.loadPage(1); and I think it does what you want.

ilovemydog
9 Mar 2017, 1:20 AM
controller method code:
store.removeAll();
store.getProxy().extraParams = {
target: target
};
this.getView().down('pagingtoolbar').moveFirst();