collapse

This method collapses the row that is passed as a parameter.

Parameters

row String|Element|jQuery

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

Returns

Promise - a promise that will be resolved once the data is loaded.

Example - returning a promise

<button id="collapse">Collapse TreeList</button>
<div id="treeList"></div>
<script>
  $("#treeList").kendoTreeList({
    columns: [
      { field: "name" },
      { field: "age" }
    ],
    dataSource: [
      { id: 1, parentId: null, name: "Jane Doe", age: 22, expanded: true },
      { id: 2, parentId: 1, name: "John Doe", age: 24 },
      { id: 3, parentId: 1, name: "Jenny Doe", age: 3 }
    ],
    selectable: true
  });
  $("#collapse").click(function(){
    var treeList = $("#treeList").data("kendoTreeList");
    treeList.collapse($("#treeList tbody>tr:eq(0)"));
  });
</script>
In this article