1. #1
    Sencha User
    Join Date
    Jun 2010
    Location
    Austria
    Posts
    12
    Vote Rating
    0
    erno is on a distinguished road

      0  

    Default How to stay on the same page after grid refresh

    How to stay on the same page after grid refresh


    Hello,

    is there any way to stay on the same page after the grid is reloaded? Currently, if I am on the page 5 and make call to refresh the grid list, I'll jump to the first page. Any way to controll it?

    thanks and regards,
    Erno

  2. #2
    Sencha User
    Join Date
    Jan 2011
    Posts
    549
    Vote Rating
    54
    willigogs is a jewel in the rough willigogs is a jewel in the rough willigogs is a jewel in the rough

      0  

    Default


    Usually this information is already passed on the call to refresh the data (start and limit parameters).

    You simply need to handle these on the server side as you would during a normal page change.

  3. #3
    Sencha User
    Join Date
    Jun 2010
    Location
    Austria
    Posts
    12
    Vote Rating
    0
    erno is on a distinguished road

      0  

    Default


    This means I need to set the start/limit params ath the server side before the response is returned?

  4. #4
    Sencha User
    Join Date
    Jan 2011
    Posts
    549
    Vote Rating
    54
    willigogs is a jewel in the rough willigogs is a jewel in the rough willigogs is a jewel in the rough

      0  

    Default


    How are you currently handling paging?

    Clicking "next" or "previous" will send "Start" and "Limit" parameters, which you should be using server side to determine what results to return from the database. Clicking "refresh" passes these exact same parameters, so should be handled in the same way as clicking "Next" or "Previous".

  5. #5
    Sencha User
    Join Date
    Jun 2010
    Location
    Austria
    Posts
    12
    Vote Rating
    0
    erno is on a distinguished road

      0  

    Default


    Well, I don't use the refresh button on the pagination toolbar. I have own button defined in tbar which is used to refresh the list. on click follwing funcion is called:

    Code:
    function reloadGridData() {
            ds.load( {
                params : {
                    id : Math.random(),
                    start : 0,
                    limit : maxRecordPerPage
                }
            });
        }
    This function is not called via refresh button only but also each time I close a "preview" window.

    Thanks

    I suppose this is the problem caus start parameter is 0. is there any other way to do that?

  6. #6
    Sencha User
    Join Date
    Jan 2011
    Posts
    549
    Vote Rating
    54
    willigogs is a jewel in the rough willigogs is a jewel in the rough willigogs is a jewel in the rough

      0  

    Default


    Have you tried simply calling store.reload()?

    This will perform a load call with identical params as sent on the previous load function.

    http://docs.sencha.com/extjs/3.4.0/#...-method-reload

  7. #7
    Sencha User
    Join Date
    Jun 2010
    Location
    Austria
    Posts
    12
    Vote Rating
    0
    erno is on a distinguished road

      0  

    Default


    Thanks willigogs! It does work ;-).

    Regards,
    Erno

Thread Participants: 1