-
Notifications
You must be signed in to change notification settings - Fork 62
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
Prevent dropping if level already has X amount of nodes. #65
Comments
sorry for the late reply. |
Thank you! I managed to get it working by finding the target level and also finding the number of nodes on that level at the same time with dplh (drag placeholder):
|
@NeoMarine I'm trying to do something very similar, could you share your code in context of the I've tried to write the following dragend(node, draggableHelperInfo) {
console.log(this.$refs.tree.dplh._vm.level;);
}, However |
I want to prevent "moving" (dragging/dropping) a node to a level that already has a specific number of nodes on that level.
For example, at level 0 (top level) I want to restrict it to just 1 node on that level, and for any other levels (children levels) I want to allow them up to 10 nodes on those levels.
Any idea how this could be accomplished?
I thought that with ondragend() function I could "return false;" after getting the "target node level" and then getting the number of nodes on that target node level, but unfortunately ondragend() does not provide any means to know what level you are moving (dragging/dropping) the node to.
For example:
The text was updated successfully, but these errors were encountered: