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

How to retrieve object mapped to a row?

1 Answer 131 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Mohamed
Top achievements
Rank 1
Mohamed asked on 12 Mar 2012, 08:37 PM
Hi,

Can anyone tell me how to retrieve the original object that was bound to the grid when a row is selected.
I attached the following callback to the "change" property of  grid.  I assume there is a way to fetch the original JSON object from this "arg" parameter.

function onChange(arg) {                
                .... Need to retrieve the object that was bound to the selected row.
                });

Thanks in advance.

1 Answer, 1 is accepted

Sort by
0
Mohamed
Top achievements
Rank 1
answered on 30 Mar 2012, 02:40 PM
Hi,

I found the answer to my question.  Here's the code to retrieves the under-lying object  from the selected row.

               var grid = ("#MyGrid).data("kendoGrid");
               var myItem = grid.select();               
               var dataItem = grid.dataItem(myItem);                
Tags
Grid
Asked by
Mohamed
Top achievements
Rank 1
Answers by
Mohamed
Top achievements
Rank 1
Share this question
or