select

Triggered when a node is being selected by the user. Cancellable. When checkboxes are enabled, it is also triggered when a node is being deselected.

Note: We don't recommend using the 'select' event when checkboxes are enabled because it is not triggered when the state of the checkbox is changed.

Event Data

e.node Element

The selected node

Example - subscribe to the "select" event during initialization

<input id="dropdowntree"/>
<script>
$("#dropdowntree").kendoDropDownTree({
  dataSource: [{ text: "item1", value: 1 }, { text: "item2", value: 2 }],
  select: function(e) {
/* The result can be observed in the DevTools(F12) console of the browser. */
    console.log("Select", e.node);
    console.log("Node text --> " + $(e.node).text())
  }
});
</script>

Example - subscribe to the "select" event after initialization

<input id="dropdowntree"/>
<script>
function dropdowntree_select(e) {
/* The result can be observed in the DevTools(F12) console of the browser. */
  console.log("select", e.node);
}
$("#dropdowntree").kendoDropDownTree({
  dataSource: [{ text: "item1", value: 1 }, { text: "item2", value: 2 }],
});
var dropdowntree = $("#dropdowntree").data("kendoDropDownTree");
dropdowntree.bind("select", dropdowntree_select);
</script>
In this article