I have been looking for an example on how to implement a button to remove a selected row, but I couldn\'t find anything useful so far.
Can anyone please give me a hint?
This works:
showSelectionCheckbox : true ->it adds checkbox to grid and $scope.delItem = function() -> it works for both multiple rows or single row selection
$scope.mySelections = [];
$scope.gridOptions = {
data :'data',
selectedItems : $scope.mySelections,
showSelectionCheckbox : true
}
$scope.delItem = function() {
for (var i = 0; i < $scope.mySelections.length; i++) {
var index = $scope.data.indexOf($scope.mySelections[i]);
if (index != -1) {
$scope.data.splice(index, 1);
}
}
}