Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get row index in angular ui-grid 3.0

Tags:

angularjs

I'm working with angular ui-grid version 3.0 and can not find the way to get the index of the row, to add a numeration column to the grid. I would like to help me.

like image 631
cristianqr Avatar asked Apr 14 '15 20:04

cristianqr


1 Answers

by using this way to solve this problem...

$http.get('./api/ioni_users')
        .success(function(data) {
            $scope.gridOptions.data = data;
            angular.forEach(data, function(data, index) {
                data["index"] = index+1;
                //data.push({"index":index+1})
            })
        });
like image 124
KARTHIKEYAN.A Avatar answered Sep 22 '22 08:09

KARTHIKEYAN.A