EasyUI
Home
Demo
Tutorial
Documentation
Download
Extension
Contact
Forum
EasyUI Forum
November 04, 2025, 09:33:52 AM
Welcome,
Guest
. Please
login
or
register
.
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
News
:
Home
Help
Search
Login
Register
EasyUI Forum
>
General Category
>
EasyUI for jQuery
>
Disallow Drag and Drop between the same tree
Pages: [
1
]
« previous
next »
Print
Author
Topic: Disallow Drag and Drop between the same tree (Read 8333 times)
leela
Newbie
Posts: 29
Disallow Drag and Drop between the same tree
«
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
Re: Disallow Drag and Drop between the same tree
«
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
« previous
next »
Jump to:
Please select a destination:
-----------------------------
General Category
-----------------------------
=> News
=> General Discussion
=> EasyUI for jQuery
=> EasyUI for Angular
=> EasyUI for Vue
=> EasyUI for React
=> Bug Report
Loading...