user300285
user300285

Reputation:

ExtJs Get the ID of the drop target

I've created an extJs drag and drop tree and I'm attemting to check whether a node exists in a particular branch before it's dropped in. To do this, I'm overwriting a method called beforeDragDrop() (Link), which passes in the whole Target tree, the Event object, and the Dragged item ID.

Calling Event.getTarget() gives me the the target node of the item adjacent to the dropped item. What I really need is the parent node within the target where this item is dropped, which will allow me to check whether the item already exists within the branch.

Is there any way of getting the id of a Tree branch within the drop target in ExtJs?

It's a long shot, but I've been faffing around for ages and could really do with a hand.

Thanks!

Upvotes: 0

Views: 3039

Answers (2)

user1578239
user1578239

Reputation: 11

var dropposition = tree.getdropPositonModel().getdropPosition();
// put it on AJAX require
params :
{
    dropid : dropposition.data.id // id from getNodes  
}

Upvotes: 1

Kenny Peng
Kenny Peng

Reputation: 1931

Is there a parent() method for the target node? What kind of object does getTarget() return?

Upvotes: 0

Related Questions