EasyUI Forum

General Category => General Discussion => Topic started by: stollar on March 17, 2016, 01:20:59 AM



Title: Drag-Drop from TREE to a DIV tag
Post by: stollar on March 17, 2016, 01:20:59 AM
I've implemented a drag-drop from a Tree to a DIV tag which is droppable - is it possible to obtain x-y coordinates on the drop zone?  Would prefer coordinates relative to the DIV tag but will settle for relative to browser top-left.

Thanks in advance,

Richard


Title: Re: Drag-Drop from TREE to a DIV tag
Post by: stworthy on March 17, 2016, 11:39:08 PM
Please try to retrieve the position of the tree proxy.
Code:
$('#dd').droppable({
accept: '.tree-node',
onDrop: function(e,source){
var proxy = $(source).draggable('proxy');
console.log(proxy.css('left')+':'+proxy.css('top'))
}
})