Get Parent Node from Kendo UI Tree View

Hi Guys!

If you want to get a parent node of the node you are dragging/dropping in Kendo UI Treeview, you need to use .parentNode() method instead of .parent() method. Mostly these methods are mixed up for when to use them. .parent() returns the array which holds this dataItem.

Here is a sample code for how you can get the parent node:

function dropLeftTree(ev) {
    var data = $("#treeview-left").data("kendoTreeView").dataItem(ev.sourceNode);
    var parent = data.parentNode()
}
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s