Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Getting values from Kendo Grid row on DetailExpand

I have got a Kendo Grid and I want to access the data from the row whose detail I expanded. For testing purposes, I have this:

function detailExpand(e)
{
    var aux = e.sender.MyModelId;
    var aux2  = this.MyModelId;
    ...

But none of those variables have the MyModelId in it.

print

I have inspected it and I can't find the model properties unless inside the e.sender._data[index-here] but I don't know the index of the row whose detail I've expanded.

like image 635
chiapa Avatar asked Dec 05 '22 23:12

chiapa


1 Answers

e.sender.dataItem(e.masterRow).MyModelId

http://docs.telerik.com/kendo-ui/api/javascript/ui/grid#events-detailExpand http://docs.telerik.com/kendo-ui/api/javascript/ui/grid#methods-dataItem

For the record, you should try to avoid using methods starting with an underscore (_). I believe kendo uses the underscore to show it's an internal method (a "private"). Unexpected behavior could occur.

like image 67
Pluc Avatar answered Feb 12 '23 05:02

Pluc