In ng-grid
, I used to use beforeSelectionChange
in the following way:
When the user selects a row, an ajax call is performed. While the ajax call is happenning I set $scope.doingAjaxCall = true
, and to prevent the user from changing the selection, I had this in the grid definition:
beforeSelectionChange: function () {
return !($scope.doingAjaxCall);
},
which locks/freezes the selection if the ajax call is happenning.
Now, in ui-grid
(aka ng-grid 3), I don't know whats the equivalent for afterSelectionChange
.
In this section of the documentation:
http://ui-grid.info/docs/#/api/ui.grid.selection.api:PublicApi
I see two events:
rowSelectionChanges
rowSelectionChangedBatch
.
These seem to be the equivalent of the old afterSelectionChange
And in this section of the documentation:
http://ui-grid.info/docs/#/api/ui.grid.selection.service:uiGridSelectionService
I see these two methods that seem to be related to the need:
raiseSelectionEvent(grid, changedRows, event)
decideRaiseSelectionEvent(grid, row, changedRows, event)
But I don't understand how to use them
Important note:
I'm using multiSelect: false
(ie: only one row can be selected)