Edit this page

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>
Is this article helpful? Yes / No
Thank you for your feedback!

Give article feedback

Tell us how we can improve this article

close
Dummy