Results 1 to 5 of 5

Thread: Possible to store selected records between pages with grid?

  1. #1

    Default Possible to store selected records between pages with grid?

    Hi,

    Is it possible to store the selected records when paging between record sets using the grid component? I'm building my first grid and I'm stumped on this.
    Thanks!

    LT

  2. #2
    Sencha User
    Join Date
    Mar 2007
    Location
    Bédoin/Nottingham
    Posts
    30,890

    Default

    It's a whole different set of Records on the next page though, which ones do you want to select?

    Or do you mean, save the selected Records on page 1, and then, after you've been to page 54, when you go back to page 1, those records are still selected? You'd have to have a saved selection for each page you visited in case you went back there at some time.

  3. #3

    Default

    Or do you mean, save the selected Records on page 1, and then, after you've been to page 54, when you go back to page 1, those records are still selected?

    -- Yes that's what I'd like to do. Is this possible?

    Thanks.
    LT

  4. #4
    Sencha User
    Join Date
    Mar 2007
    Location
    Bédoin/Nottingham
    Posts
    30,890

    Default

    Yep. Just have a huge Array (though it will only really get huge if you visit a lot of pages).

    In a beforeload handler of your store, collect the current selected IDs, and store them under index <your PagingToolbar>.cursor.

    And in a load handler, look at the page that's just been loaded ( <your PagingToolbar>.cursor ) and restore selections from the saved ID Array.

  5. #5

    Default

    Awesome! Thanks!
    LT

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •