parentNode

Gets the parent node.

Returns

kendo.data.Node—The parent of the node. Returns null if the node is a root node or does not 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>
In this article
Not finding the help you need? Improve this article