Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ngGrid - remove row

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? Here is the plunker example.

The function I implement acts weird, as it removes other rows.

Thank you.

like image 395
oblivion19 Avatar asked Jun 28 '13 15:06

oblivion19


1 Answers

That is not a proper way to delete any row

Try like this:

$scope.removeRow = function() {
   var index = this.row.rowIndex;
   $scope.gridOptions.selectItem(index, false);
   $scope.myData.splice(index, 1);
};

PLUNKER --> Its working and tested

like image 81
Dhaval Marthak Avatar answered Sep 21 '22 13:09

Dhaval Marthak