This is a migrated thread and some comments may be shown as answers.

Destination node during drag event?

1 Answer 129 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Kyle
Top achievements
Rank 1
Kyle asked on 04 May 2012, 05:14 PM
In a TreeView I can add the following:

.bind("drag", function(e) {

        })

Which allows me to access the dropTarget, which is a DomElement. How can I go about both determining if this is a tree node, and getting said tree node?

1 Answer, 1 is accepted

Sort by
0
Alex Gyoshev
Telerik team
answered on 09 May 2012, 06:51 AM
Hello Kyle,

var node = $(e.dropTarget).closest(".k-item");

if (node.length && node.parents(".k-treeview").length) {
    // the dropTarget is within the treeview,
    // `node` is the closest treeview item

}

Greetings,
Alex Gyoshev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Tags
TreeView
Asked by
Kyle
Top achievements
Rank 1
Answers by
Alex Gyoshev
Telerik team
Share this question
or