EasyUI Forum
November 04, 2025, 01:24:10 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: Tree onDrop  (Read 7460 times)
stollar
Newbie
*
Posts: 7


View Profile Email
« on: February 21, 2016, 10:34:39 AM »

I need to send drag-drop details back to the server with an ajax call.

However the onDrop(target, source, point) function gives me the target as the DOM element, the source is the node being dragged. What I need is the data-item where we're dropping so how do we get from the DOM-target to the tree-node where we drop?

Logged
jarry
Administrator
Hero Member
*****
Posts: 2300


View Profile Email
« Reply #1 on: February 21, 2016, 04:55:17 PM »

You can call 'getNode' method to get the target node data.
Code:
onDrop: function(target,source,point){
var targetNode = $(this).tree('getNode', target);
console.log(targetNode)
}
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!