Reputation: 555
I have kendo grid. This grid contains hierarchy of detail grids.
Can I take dataItem for this detail grid when I click by row?
Upvotes: 1
Views: 1652
Reputation: 1572
This work for me:
$("#main_grid_id").data("kendoGrid").dataItem($(e.currentTarget).closest("tr.k-detail-row").prev("tr"))
Upvotes: 0
Reputation: 903
{
title: "Click",
width: "100px",
command: [
{
name: "Click",
click: function (e) {
e.preventDefault();
var dataItem = this.dataItem($(e.currentTarget).closest("tr"));
// You can access value of column by dataItem.columnID
}
}
]
}
Here is a command name 'Click' in kendo grid. When you will click on command, appropriate function will execute.
Upvotes: 1
Reputation: 555
You can use following callback code.
function(e) { console.log($(e.target.closest('.k-grid')).data("kendoGrid").dataItem(e.target)); }
Upvotes: 2