Search code examples
angularjsangular-ui-gridui-grid

how to get row index in cellTemplate of angular ui-grid


ng-click="grid.appScope.selectItem($event,row.entity.$index);" i want to pass row index through this function. Even if i tried with $index,$parent.$index. I am unable to get the index.


Solution

  • try rowRenderIndex or $parent.$index

    ng-click="grid.appScope.selectItem($event, rowRenderIndex);"
    

    or

    ng-click="grid.appScope.selectItem($event, $parent.$index);"