Edit this page

collapse

Collapses nodes.

Example

<div id="treeview"></div>
<script>
$("#treeview").kendoTreeView({
  dataSource: [
    { text: "foo", expanded: true, items: [
      { text: "bar" }
    ] },
    { text: "baz", expanded: true, items: [
      { text: "qux" }
    ] }
  ]
});

var treeview = $("#treeview").data("kendoTreeView");
// collapse the item with text "foo"
treeview.collapse(treeview.findByText("foo"));

// collapse all items
treeview.collapse(".k-item");
</script>

Parameters

nodes jQuery |Element |String

The nodes that will be collapsed.

Is this article helpful? Yes / No
Thank you for your feedback!

Give article feedback

Tell us how we can improve this article

close
Dummy