Preserving checked rows state while paginating

307 views
Skip to first unread message

NeoSwf

unread,
Jun 19, 2012, 9:24:12 AM6/19/12
to slic...@googlegroups.com
Hi
This topic is more about request of advice.

I have a grid which contain the two features: Pager & RowCheckbox Plugins.
I wish to maintain the state of selected rows while move between different pages.

My idea is to maintain an array on every pager's page change, using grid.getSelectedRows(), and set selected rows on reaching each page using grid.setSelectedRows().

What do you guys think? is there a better way? built in one?

Michael Leibman

unread,
Jun 19, 2012, 6:23:25 PM6/19/12
to slic...@googlegroups.com
Assuming you are using a DataView, this is simple:

// if you don't want the items that are not visible (due to being filtered out
// or being on a different page) to stay selected, pass 'false' to the
second arg
dataView.syncGridSelection(grid, true);
Message has been deleted

NeoSwf

unread,
Jun 20, 2012, 10:27:43 AM6/20/12
to slic...@googlegroups.com
Tin, do I have to call this method everytime I change a page? or just place it at the bottom, like u did in example 4, should be enough?
(btw, I already resolved it, but I want to implement your method cause its a built in one)

Michael Leibman

unread,
Jun 20, 2012, 2:17:37 PM6/20/12
to slic...@googlegroups.com
You need to call it once when you initialize the DataView.

Shlomi Asaf

unread,
Jun 20, 2012, 2:22:09 PM6/20/12
to slic...@googlegroups.com
Does it suppose to work at example 4, when I choose a row, and activate pagination?

NeoSwf

unread,
Jul 17, 2012, 6:25:21 PM7/17/12
to slic...@googlegroups.com
Tim - is there a built in method to collect the checked items in different pages?

grid.getSelectedRows() returning me only the current page.
Reply all
Reply to author
Forward
0 new messages