[CLOSED] Grid load reset starting page

  1. #1

    [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?
    Last edited by Daniil; Oct 14, 2015 at 12:10 PM. Reason: [CLOSED]
  2. #2
    I am working up a example right now. Extending the GridPanel --> Plugins --> GridFilters Remote
  3. #3
    Hi Chris,

    In similar scenarios I am used to recommend the option #1. To me it is more intuitive for a user. If I click on a new node, I would expect to see the loaded data from the begging (i.e. the first page) disregarding what the page was for the previous node. Say, you are on the page #3, then click on another node and the current e.Start loads the page #4 or any other or even an empty page as in the case that you are considering. So, to me the option #2 is more intuitive. Also the option #2 means a possibility of an overhead request that I also don't quite like. One more thing that it will blink 0 it first loads an empty page, then it loads a not empty page. I don't think a user is going to like it.

    Though, it is only my opinion. Maybe, in your case the option #2 is the best.
  4. #4
    I found an thread that matches my issue exactly.

    Remote-Paging-using-Store

    I have been able to duplicate it in an example and will try to apply it to my code tomorrow and let you know the status.
  5. #5
    Please close the thread. I used loadPage(1) instead of load on the store to reset the page counter.

Similar Threads

  1. Expanding rows of Grid control at page load
    By dkhandelwal in forum 2.x Help
    Replies: 1
    Last Post: Sep 07, 2015, 12:56 PM
  2. Grid load all records on firts page (on load)
    By equiman in forum 1.x Help
    Replies: 0
    Last Post: Nov 21, 2013, 6:18 PM
  3. Replies: 3
    Last Post: Aug 01, 2012, 6:51 PM
  4. Replies: 2
    Last Post: Oct 29, 2010, 10:04 AM
  5. how to load data to grid panel in page load
    By andylaiyongsing in forum 1.x Help
    Replies: 1
    Last Post: Apr 16, 2010, 10:27 AM

Posting Permissions