Edit this page

collapse

Triggered before a subgroup gets collapsed. Cancellable.

Event Data

e.node Element

The collapsed node

Example - subscribe to the "collapse" event during initialization

<div id="treeview"></div>
<script>
$("#treeview").kendoTreeView({
  dataSource: [
    { text: "foo", items: [
      { text: "bar" }
    ] }
  ],
  collapse: function(e) {
    console.log("Collapsing", e.node);
  }
});
</script>

Example - subscribe to the "collapse" event after initialization

<div id="treeview"></div>
<script>
function tree_collapse(e) {
  console.log("Collapsing", e.node);
}
$("#treeview").kendoTreeView({
  dataSource: [
    { text: "foo", items: [
      { text: "bar" }
    ] }
  ]
});
var treeview = $("#treeview").data("kendoTreeView");
treeview.bind("collapse", tree_collapse);
</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