Row selection when paging
With serverside paging setup, select a row, page forward and then page back. The row is still selected according to the selected row count (as well as the selection array in the grid options), but the row does not display as selected.
I tried manually selecting the row with selectItem() when paging but that ended up not selecting the row, but adding a duplicate to the selection array.
Verified with the plunkr connected to the serverside paging example
http://plnkr.co/edit/zBbFOTsf1hvTXjK0NzU2?p=preview
(you do need to add showFooter: true to the gridOptions, which I was close to having a plunkr for but then got sidelined by something...)
I need to run out of work right now, but I will try and setup a plunk which more clearly shows this later tonight
you need to use the {primaryKey: "PropertyField"} option when server side-paging to allow the grid to know whether or not something is selected. the reason why is that the object comparison is done via reference ob objects, not value. When you do server-side paging, new object references are created when the data is requested (unless you cache them locally somewhere).
On Mon, Apr 1, 2013 at 1:40 PM, mxreppy [email protected] wrote:
With serverside paging setup, select a row, page forward and then page back. The row is still selected according to the selected row count (as well as the selection array in the grid options), but the row does not display as selected.
I tried manually selecting the row with selectItem() when paging but that ended up not selecting the row, but adding a duplicate to the selection array.
Verified with the plunkr connected to the serverside paging example
http://plnkr.co/edit/zBbFOTsf1hvTXjK0NzU2?p=preview
(you do need to add showFooter: true to the gridOptions, which I was close to having a plunkr for but then got sidelined by something...)
I need to run out of work right now, but I will try and setup a plunk which more clearly shows this later tonight
— Reply to this email directly or view it on GitHubhttps://github.com/angular-ui/ng-grid/issues/293 .
-Tim Sweet
tim can you reopen? I'm seeing a crash when paging. I think it's in ng-grid not angular, but I'm not sure.
I think this plunkr shows it:
http://plnkr.co/edit/TGIpIY
to reproduce, select a row, then page forward. This stack trace is in the console
Error: 'undefined' is not a function (evaluating 'self.pkeyParser(c)')
@http://angular-ui.github.com/ng-grid/lib/ng-grid.debug.js:2563
forEach@[native code]
n@https://ajax.googleapis.com/ajax/libs/angularjs/1.0.5/angular.min.js:6
getSelection@http://angular-ui.github.com/ng-grid/lib/ng-grid.debug.js:2566
ensureEntity@http://angular-ui.github.com/ng-grid/lib/ng-grid.debug.js:2027
@http://angular-ui.github.com/ng-grid/lib/ng-grid.debug.js:2827
forEach@[native code]
n@https://ajax.googleapis.com/ajax/libs/angularjs/1.0.5/angular.min.js:6
dataWatcher@http://angular-ui.github.com/ng-grid/lib/ng-grid.debug.js:2830
$digest@https://ajax.googleapis.com/ajax/libs/angularjs/1.0.5/angular.min.js:85
$apply@https://ajax.googleapis.com/ajax/libs/angularjs/1.0.5/angular.min.js:87
e@https://ajax.googleapis.com/ajax/libs/angularjs/1.0.5/angular.min.js:94
o@https://ajax.googleapis.com/ajax/libs/angularjs/1.0.5/angular.min.js:97
onreadystatechange@https://ajax.googleapis.com/ajax/libs/angularjs/1.0.5/angular.min.js:98
[native code]