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

Retrieving datakey through javascript

1 Answer 122 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Adam Boyd
Top achievements
Rank 1
Adam Boyd asked on 30 Sep 2013, 01:43 PM
I've seen this approach:

var formId = this.select().closest("tr").find("td:eq(1)").text()

The problem is that's taking a value from the grid that I assume is included in the columns collection.  How do I set a datakey that's not visible in the grid and retrieve it?  Is there a simple way to do that or am I just being obtuse?

1 Answer, 1 is accepted

Sort by
0
Alexander Valchev
Telerik team
answered on 30 Sep 2013, 03:25 PM
Hi Adam,

If I understood correctly you are looking for a way to access the underlying dataItem that holds all the data for the current row. If that is correct please use the dataItem method of the Grid widget. The method accepts <tr> element and returns Observable Object which contains all the data associated with the row (even the hidden fields).

Regards,
Alexander Valchev
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
Adam Boyd
Top achievements
Rank 1
Answers by
Alexander Valchev
Telerik team
Share this question
or