Edit this page

collapseRow

Collapses the specified master table row. This hides its detail table row.

Parameters

row String |Element |jQuery

A string, DOM element or jQuery object which represents the master table row. A string is treated as a jQuery selector.

Example - collapse the first master table row

<div id="grid"></div>
<script>
$("#grid").kendoGrid({
  columns: [
    { field: "name" },
    { field: "age" }
  ],
  dataSource: [
      { name: "Jane Doe", age: 30 },
      { name: "John Doe", age: 33 }
  ],
  detailTemplate: "<div>Name: #: name #</div><div>Age: #: age #</div>"
});
var grid = $("#grid").data("kendoGrid");
// first expand the first master table row
grid.expandRow(".k-master-row:first");
grid.collapseRow(".k-master-row:first");
</script>