Oct 12, 2015, 7:09 PM
[CLOSED] Grid load reset starting page
Let me see if I can describe this without an example.
I have a Grid, Store (PageSize=20) and PagingToolbar and I load the data based on a tree panel item. So based on the treenode it might show 120 items, but when I select a different tree node it will show 10.
I have never noticed this in my code until yesterday (I guess I didn't test very well). If I select the tree node with 120 items it says I am on page 1 of 6. I then go to page 2 and everything looks fine, but when I select the next tree node with only 10 items nothing shows in the grid and it states that I am on page 1 of 1. I assume the store thinks I am on page 2 since I use the e.Start and e.Limit in my query. If I press the refresh on the paging toolbar it refreshes the screen properly.
So I guess I need to determine a couple of things:
1) Should I always start back at Page 1 when I refresh a store.
2) If no items are returned and my e.Start doesn't equal 0, then reset e.Start and query again.
I think I like option 2 better. What are your thoughts?
I have a Grid, Store (PageSize=20) and PagingToolbar and I load the data based on a tree panel item. So based on the treenode it might show 120 items, but when I select a different tree node it will show 10.
I have never noticed this in my code until yesterday (I guess I didn't test very well). If I select the tree node with 120 items it says I am on page 1 of 6. I then go to page 2 and everything looks fine, but when I select the next tree node with only 10 items nothing shows in the grid and it states that I am on page 1 of 1. I assume the store thinks I am on page 2 since I use the e.Start and e.Limit in my query. If I press the refresh on the paging toolbar it refreshes the screen properly.
So I guess I need to determine a couple of things:
1) Should I always start back at Page 1 when I refresh a store.
2) If no items are returned and my e.Start doesn't equal 0, then reset e.Start and query again.
I think I like option 2 better. What are your thoughts?
Last edited by Daniil; Oct 14, 2015 at 12:10 PM.
Reason: [CLOSED]