I have a kendo grid in my view named "Grid" and I have a treeview named "treeview".
I'm attempting to enable dragging from the Grid to the treeview. I'm able to get the value of the item I'm dragging but I'm unable to get the value of where I'm dropping it (destination).
This is my document.ready()...
var grid = $("#Grid").data("kendoGrid"), treeview = $("#treeview").data("kendoTreeView"), itemUID;
grid.table.kendoDraggable({
cursorOffset: {
top: 5,
left: 5
},
filter: "tbody > tr",
group: "Grid",
hint: function (e) {
itemUID = e.attr(kendo.attr("uid"));
var z = $(e).find('.ZID');
itemUID = z.html();
return $('<div class="k-grid k-widget"><table><tbody><tr>' + e.html() + '</tr></tbody></table></div>');
}
});
treeview.element.kendoDropTarget({
group: "Grid",
drop: function (e) {
console.log(e.draggable);
// Value of dragged item
alert("Dragged row 'Id' " + itemUID);
itemUID = null;
}
});
I ended up figuring it out:
var dest = $(e.toElement).text();
Now that I got the target and destination how do I update the treeview with the newly dragged item?