detailCollapse
Fired when the user collapses a detail table row.
The event handler function context (available via the this
keyword) will be set to the widget instance.
Event Data
e.detailRow jQuery
The jQuery object which represents the detail table row.
e.masterRow jQuery
The jQuery object which represents the master table row.
e.sender kendo.ui.Grid
The widget instance which fired the event.
Example - subscribe to the "detailCollapse" event during initialization
<div id="grid"></div>
<script>
let encode = kendo.htmlEncode;
$("#grid").kendoGrid({
columns: [
{ field: "name" },
{ field: "age" }
],
dataSource: [
{ name: "Jane Doe", age: 30 },
{ name: "John Doe", age: 33 }
],
detailTemplate: ({ name, age }) => `<div>Name: ${encode(name)}</div><div>Age: ${encode(age)}</div>`,
detailCollapse: function(e) {
/* The result can be observed in the DevTools(F12) console of the browser. */
console.log(e.masterRow, e.detailRow);
}
});
</script>
Example - subscribe to the "detailCollapse" event after initialization
<div id="grid"></div>
<script>
let encode = kendo.htmlEncode;
function grid_detailCollapse(e) {
/* The result can be observed in the DevTools(F12) console of the browser. */
console.log(e.masterRow, e.detailRow);
}
$("#grid").kendoGrid({
columns: [
{ field: "name" },
{ field: "age" }
],
dataSource: [
{ name: "Jane Doe", age: 30 },
{ name: "John Doe", age: 33 }
],
detailTemplate: ({ name, age }) => `<div>Name: ${encode(name)}</div><div>Age: ${encode(age)}</div>`
});
var grid = $("#grid").data("kendoGrid");
grid.bind("detailCollapse", grid_detailCollapse);
</script>