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?
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);
On Tue, Jun 19, 2012 at 6:24 AM, NeoSwf <neo...@gmail.com> wrote:
> 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?
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)
On Wed, Jun 20, 2012 at 7:27 AM, NeoSwf <neo...@gmail.com> wrote:
> 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)
> You need to call it once when you initialize the DataView.
> On Wed, Jun 20, 2012 at 7:27 AM, NeoSwf <neo...@gmail.com> wrote:
> > 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)
On Wednesday, June 20, 2012 3:22:09 PM UTC-3, NeoSwf wrote:
> Does it suppose to work at example 4, when I choose a row, and activate > pagination?
> On Wed, Jun 20, 2012 at 3:17 PM, Michael Leibman < > michael.leib...@gmail.com> wrote:
>> You need to call it once when you initialize the DataView.
>> On Wed, Jun 20, 2012 at 7:27 AM, NeoSwf <neo...@gmail.com> wrote: >> > 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)