Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

AngularJS ng-grid with custom button

Tags:

I am using angular button in a ng-grid. I need to know how can i identity which button was clicked from within the grid.

I guess part of the complexity is that the button is clicked before the row is selected (Just my analysis,probably wont help with the solution :)

A snap shot of how the grid looks

ng-grid

A plunker illustrating the problem here

like image 272
Sudarshan Avatar asked Mar 26 '13 03:03

Sudarshan


1 Answers

I have been able to find out how to resolve my question,basically pass in "row" as an argument on your function for ng-click. ng-click="save(row)"

Before

.. ng-click="edit(selectedItem)" >Edit</button> ' 

After

.. ng-click="edit(row)" >Edit</button> ' 

I have updated the plunker here to reflect the same

row.entity will give me the entity bound to this row of the grid

like image 63
Sudarshan Avatar answered Oct 13 '22 04:10

Sudarshan