ui-grid icon indicating copy to clipboard operation
ui-grid copied to clipboard

Angular UI grid - Enabling saveRowIdentity using grid options

Open jawaharlalt opened this issue 9 years ago • 1 comments

@c0bra How to enable 'saveRowIdentity' grid options?

Since ui-grid saving the index of the grid row to persist the selection after data operations. this would cause the issue when we doing sorting. Enabling 'saveRowIdentity' will solve this by saving the row entity instead of index so, we can do the trick with row entity and select back the correct row even after the sorting.

Note: Enabling saveRowIdentity in grid options lead an error.

TypeError: grid.options.saveRowIdentity is not a function

Thanks in advance

jawaharlalt avatar Mar 03 '17 10:03 jawaharlalt

Got it, thanks

$scope.rowEntitySave = function(rowEntity) { return rowEntity.field; }

// configurations saveRowIdentity: $scope.rowEntitySave,

jawaharlalt avatar Mar 13 '17 07:03 jawaharlalt