Edit this page

detach

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

Parameters

node jQuery |Element |String

The node that is to be detached.

Returns

jQuery The node that has been detached.

Example - remove the node with ID, firstItem

<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);
console.log(item.data("id")); // logs "abc"
</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