This is a migrated thread and some comments may be shown as answers.

Retrieve grid row for ng-click callback

1 Answer 403 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Rajesh
Top achievements
Rank 1
Rajesh asked on 23 Aug 2014, 06:14 PM
I have an angular-kendo-grid with a row template as below.

rowTemplate: "<tr data-uid='#: uid #'>" +
                        "<td align='center'> <input type='checkbox' ng-click='checkboxClicked(event)' ng-model='dataItem.selected' /></td>" +
                        "<td>{{dataItem.hostname}}</td>"

I need to detect which row's checkbox has been clicked. checkboxClicked is called with an undefined arg when used as above.

The grid is defined as 

<div  kendo-grid="availableDevicesGrid" k-options="availableDevicesKOptions"
 ....

However, $scope.availableDevicesGrid is always undefined in the controller.

I have a select all checkbox and a checkbox at each row and all I need to do is to find out which rows have been selected. Any help would be appreciated ?

1 Answer, 1 is accepted

Sort by
0
Atanas Korchev
Telerik team
answered on 27 Aug 2014, 06:54 AM
Hi Rajesh,

You should try this:

 '<input type="checkbox" ng-click="checkboxClicked(dataItem)">'

Here is a live demo: http://dojo.telerik.com/@korchev/eNUC

More info is available here.

Regards,
Atanas Korchev
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
Tags
Grid
Asked by
Rajesh
Top achievements
Rank 1
Answers by
Atanas Korchev
Telerik team
Share this question
or