-
Notifications
You must be signed in to change notification settings - Fork 770
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cancel the drop event #31
Comments
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? |
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/ |
Excellent addition, well done! This is much better way than my hack. |
@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 I've tried with Is there any other event I can use? like Thanks |
Hi.
I was wondering if it is possible to cancel the drag & drop event if some criteria are not met. For example, I do not want an employee to be under a specific department under no circumstance.
I have already found a way to check if the dropZone should be valid or not but I have not found a way to return the dragged node to its previous position.
Is what I am asking even possible?
Thanks
The text was updated successfully, but these errors were encountered: