Comments (4)
After I dug around a little bit more I found a way.
First of all I moved the triggerHandler to the top of the drop event handler, after the variable declarations. Since the triggerHandler returns a value, I assigned that value to a variable and if that variable is 1 then I continue with the changes in the DOM.
Is this way ok or I am missing something?
from orgchart.
Hi @achatzi78. I just published version 1.1.1 that provides option "dropCriteria" that could help users to limit the relationships between dragged node and drop zone. For more details, you could refer to http://dabeng.github.io/OrgChart/drag-drop/
from orgchart.
Excellent addition, well done!
This is much better way than my hack.
from orgchart.
@dabeng AFAIK, the dropcriteria only works to allow or deny the drop, but what if we want to cancel the drop once it happened?
I'm asking because I'm showing a confirm modal dialog after the drop and I only want to accept the drop if the user click's on accept
. If the user clicks on cancel
then the drop wouldn't happen.
I've tried with event.stopPropagation()
and event.preventDefault()
but they don't cancel the drop. I've also tried with the dragend.orgchart
event but it doesn't cancel the drag either.
Is there any other event I can use? like beforeNodeDropped
?
Thanks
from orgchart.
Related Issues (20)
- 如何通过参数设置隐藏兄弟节点 HOT 1
- 请问大佬data-prop-compact.html这个demo是不是有异常 HOT 3
- not able export chart in png roper
- ajaxURL HOT 2
- Sort siblings HOT 1
- orgchart with nodes of different widths don't work HOT 1
- drag & drop the nodes of orgchart don't work
- multiple-layers chart don't work HOT 1
- specific children of a certain branch of the chart to be displayed as vertical. the possibility to set VerticalLevel by data don't work. HOT 1
- I want to using 'compact' and 'verticalLevel' option together.
- Option to see that nodes have relations (parent/son/sibling) although they may not be visible without hovering over nodes individually HOT 2
- If you call oc.init(...) multiple times, some values are not reset resulting in unexpected behavior.
- Combining collapsed and hybrid modes
- options.compact() does not prevail over data.compact (as documented)
- Copying and pasting a CDN link directly can result in errors.
- 为增加兄弟节点函数增加指定增加到右边的参数选项
- rendering graph in bullet list format HOT 1
- orgchart() undefined
- Wrap Edges in button tags (Accessibility)
- How can I implement dabeng/OrgChart to livewire app
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from orgchart.