Closed yubik9 closed 10 years ago
Grid.getSelectedIds
is effectively the same as:
_.map(grid.getSelectedModels(), function (model) { return model.id; } );
Grid.clearSelection
can be greatly simplified to:
_.map(grid.getSelectedModels(), function (model) { model.trigger("backgrid:select", model, false) } );
Your implementation is way too complicated
It won't work with pageable extension as there is no fullCollection available.
Do you have any idea how to deal with this situation?
On Friday, October 11, 2013, Jimmy Yuen Ho Wong wrote:
Grid.getSelectedIds is effectively the same as:
_.map(grid.getSelectedModels(), function (model) { return model.id; } );
Grid.clearSelection can be greatly simplified to:
_.map(grid.getSelectedModels(), function (model) { model.trigger("backgrid:select", model, false) } );
Your implementation is way too complicated
— Reply to this email directly or view it on GitHubhttps://github.com/wyuenho/backgrid-select-all/pull/6#issuecomment-26112043 .
Since we're simplifying
getSelectedIds
_.pluck(grid.getSelectedModels(), 'id');
@fanminjian, do you mean that you want to persist the selection across many pages?
It is useful to allow people clear selection and get selected items ids.
Not all the models will be returned if they are using pageable extension.