The Muffin Man
The Muffin Man

Reputation: 20004

Getting element id from Kendo UI treeview drag and drop

On the drop event you get back an object that allows you to get the source and destination elements, however I can't see anything available in these objects that helps me identify them uniquely against the datasource.

When I originally databound all of these objects I set an id for each item, but that id is not available in the drop event source/destination elements.

The documentation on the Kendo UI site only goes as far as explaining that there is source/destination objects, not how to do anything with them.

I want to get the source and destination ids so that I can go to the database, remove the source and add it to the destination.

Upvotes: 1

Views: 859

Answers (1)

The Muffin Man
The Muffin Man

Reputation: 20004

So by process of some voodoo magic you can get what you need like so:

e.sender.dataItem(e.destinationNode)

_childrenOptions: Object
_events: Object
_loaded: false
children: J.extend.init
dirty: false
enabled: true
hasChildren: true
id: 3
index: 2
items: ct.extend.init[0]
parent: function (){return i}
text: "Sales"
uid: "fedfd9ca-83bf-45ba-a14d-4127f8cc1560"
__proto__: n.extend.r

Upvotes: 3

Related Questions