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()
}