PDA

View Full Version : Possible to store selected records between pages with grid?



lagos.tout
7 Mar 2008, 1:45 AM
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

Animal
7 Mar 2008, 1:52 AM
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.

lagos.tout
7 Mar 2008, 2:04 AM
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

Animal
7 Mar 2008, 2:46 AM
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.

lagos.tout
10 Mar 2008, 10:42 AM
Awesome! Thanks!
LT