toggle

Toggles the node of a TreeView between its expanded and collapsed states.

Parameters

node jQuery|Element|String

The node that should be toggled.

Example

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

var treeview = $("#treeview").data("kendoTreeView");

treeview.toggle(".k-item:first");

var baz = treeview.findByText("baz");
treeview.toggle(baz);
</script>
In this article