开发者

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 beforeDra开发者_运维百科gDrop() (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!


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


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

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜