PDA

View Full Version : Reload store with dynamic values



marc123
12 Oct 2012, 3:20 AM
Hi,

I have a gridpanel with a paging toolbar. There are 3 pages. There is a timer configured on the gridPanel's dataStore so I can configure the dataStore to perform a reload after nn secs. The load() accesses a backend and sends along parameters like startRow and maxrows. Problem is, those params are static: maxrows=15 and startrow=0. That's fine if a reload takes place when page 1 is displayed in the grid but when page 3 is displayed, a reload retrieves the data for the first page. Worse, the pageindicator keeps indicating page 3 is shown.
So how can I send te _actual_ value of the dataStore property startRow with the load() call?

Marc

scottmartin
12 Oct 2012, 5:13 AM
What do you want to happen ... reload page 1 with it's data, or remain on page 3 with page 3 data?

Scott.

vietits
12 Oct 2012, 5:24 AM
It seems that marc123 wants to re-load the current page. If so, you should use <store>.loadPage(<store>.currentPage).