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"));
/* The result can be observed in the DevTools(F12) console of the browser. */
console.log(treeview.text(parent)); // logs "foo"

parent = treeview.parent(parent);
/* The result can be observed in the DevTools(F12) console of the browser. */
console.log(parent.length); // logs 0
</script>
In this article