New to Kendo UI for jQueryStart a free 30-day trial

Detach

methods

Removes a node from a TreeView, but keeps its jQuery.data() objects.

Parameters:nodejQuery|Element|String

The node that is to be detached.

Returns:jQuery

The node that has been detached.

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

var treeview = $("#treeview").data("kendoTreeView");
var item = treeview.findByText("foo");
item.data("id", "abc");
treeview.detach(item);
/* The result can be observed in the DevTools(F12) console of the browser. */
console.log(item.data("id")); // logs "abc"
</script>
Not finding the help you need?
Contact Support