EasyUI Forum
November 04, 2025, 04:53:33 AM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: Disallow Drag and Drop between the same tree  (Read 8330 times)
leela
Newbie
*
Posts: 29


View Profile Email
« on: July 23, 2014, 08:15:49 AM »

Hi,

 I have 2 trees, The user should be able to drag and drop the elements from the left tree to the right tree.
 But disallow drag and drop between the left tree. Is there a way I can find , if both source and target belong to the same tree in any of the events (onDragOver, onBeforeDrop)

  When user tries to drag something from my left tree with in left tree, I should be able to recognize it and prevent it.

  Please advise.
Logged
stworthy
Administrator
Hero Member
*****
Posts: 3581


View Profile Email
« Reply #1 on: July 23, 2014, 05:23:53 PM »

Return false in the 'onDragEnter' event and the target node will not be dropped.
Code:
$('#leftTree').tree({
onDragEnter:function(target, source){
return false;
}
})
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!