Skip to content
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

Drag&Drop only for changing the parent node #97

Open
ruxoft opened this issue Jan 14, 2019 · 2 comments
Open

Drag&Drop only for changing the parent node #97

ruxoft opened this issue Jan 14, 2019 · 2 comments

Comments

@ruxoft
Copy link

ruxoft commented Jan 14, 2019

Hallo, is it possible to use drag&drop only to change the parent node? Not for reordering in the same parent node or in other parent node? As a result, the blue line below the node would not be displayed, but only the rectangle around the new parent node. Thank you.

@amsik
Copy link
Owner

amsik commented Jan 14, 2019

Hi. Yes, it is possible. Use onDragOn and onDragFinish properties for that. I'm not able to check now but hope it works :) Try this code:

 {
  dnd: {
    onDragOn(targetNode, destinationNode) {
      return destinationNode.children.length > 0
    }
  }
 }

@ruxoft
Copy link
Author

ruxoft commented Jan 28, 2019

Thank you, it can help, but what I need in other words: There are three types of drop: ABOVE, BELOW and ON. I need to disable above and below and keep only ON type. I tried rewrite css styles:

.drag-above > .tree-content::before, .drag-below > .tree-content::after { content: none!important; }

and handle events onDragOn and onDragFinish, but wihout success in this time. The new parametr "destination" of these events would help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants