Edit this page

parentNode

Gets the parent node.

Returns

kendo.data.Node the parent of the node; null if the node is a root node or doesn't have a parent.

Example - get the parent node

<script>
var dataSource = new kendo.data.HierarchicalDataSource({
   data: [
       {
           id: 1,
           text: "Root",
           items: [
               { id: 2, text: "Child" }
           ]
       }
   ]
});
dataSource.read();
var root = dataSource.get(1);
console.log(root.parentNode()); // outputs "null"
root.load(); // load child nodes
var child = dataSource.get(2);
console.log(child.parentNode().text); // outputs "Root"
</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