Edit this page

parent

Gets the parent node of the item

Parameters

node jQuery |Element |String

The child node whose parent will be returned.

Returns

jQuery The parent node of the given parameter node.

Example

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

var treeview = $("#treeview").data("kendoTreeView");

var parent = treeview.parent(treeview.findByText("bar"));
console.log(treeview.text(parent)); // logs "foo"

parent = treeview.parent(parent);
console.log(parent.length); // logs 0
</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