EasyUI Forum
June 22, 2024, 07:54:02 PM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: Drag-Drop from TREE to a DIV tag  (Read 5272 times)
stollar
Newbie
*
Posts: 7


View Profile Email
« 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
Logged
stworthy
Administrator
Hero Member
*****
Posts: 3581


View Profile Email
« Reply #1 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'))
}
})
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!