I am customizing a cell template in an ng grid. In this cell, I want to have a button that will trigger some kind of event that needs a row index in the original data array. The template is as follows:
<button class="btn" ng-click="removeItem(row.rowIndex)">
<i class="icon-remove"></i>
</button>
and removeItemis executed as follows:
$scope.removeItem = function(rowIndex) { $scope.myList.splice(rowIndex, 1) }
This works until I sort the grid by clicking one of the columns. Apparently rowIndex is a visual row pointer, not the row index in the array I provided.
Is there a way to get the actual index?
source
share