-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Description
Our dataset, as I'm sure many others also use, has an ID for records, let's call this field: id
In our web application, instead of passing around entire entities, we just pass the ids
of these records.
NOTE: Our grids do not display the ID column so our columnDefs
does not include this column. Perhaps including this column and making the column hidden would allow faster selection/searching? But then we are also adding potentially many unnecessary DOM elements to the GRID.
What's the most efficient way to find a grid row for selection using an id
.
The only way I can think of achieving this is by:
- Iterate through $scope.gridOptions.data looking for item
- Call
$scope.gridApi.selection.selectRow(rowEntity, event)
passing in item found in step 1 for rowEntity.
However, I'm not sure if there's a more efficient way (using grid hashing maybe)?
In some instances, I get an array of IDs to select. So I would have to loop through the above pseudo-code for each ID in IDs, which would create an O(n^2) operation. I was hoping there would be something more performant.