liquor-tree
liquor-tree copied to clipboard
Drag&Drop only for changing the parent node
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.
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
}
}
}
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.