1. #1
    Sencha User
    Join Date
    May 2011
    Posts
    11
    Vote Rating
    0
    javafreshman is on a distinguished road

      0  

    Default How to reset paging config

    How to reset paging config


    Found that the paging example (http://sencha.com/examples/#paging) will remember the page I selected last time. Such as when I switch to page 3 and then delete cookie, cache from IE and close the browser. When I open the browser again, the grid still can automatically swtich to page 3 when the example load to the browser.

    How can I reset the page and sorting field config everytime I reload the page?

  2. #2
    Sencha - GXT Dev Team
    Join Date
    Feb 2009
    Location
    Minnesota
    Posts
    2,731
    Vote Rating
    90
    Colin Alworth is a glorious beacon of light Colin Alworth is a glorious beacon of light Colin Alworth is a glorious beacon of light Colin Alworth is a glorious beacon of light Colin Alworth is a glorious beacon of light

      0  

    Default


    In that example, the relevant code is here:

    Code:
    final Grid<Post> grid = new Grid<Post>(store, cm);  
    grid.setStateId("pagingGridExample");
    grid.setStateful(true);
    Look in your cookies for that domain for a cookie called pagingGridExample - the data is stored in that. Close the page, clear the cookie, and re-open it to reset.

    If you are trying to implement this yourself, start with those setters in the example - if you need to reset it, one option would be to invoke setters on the toolbar, as that is what is used to drive the state that is persisted in cookies.

Thread Participants: 1