Hey there, I noticed there is a ton of really nice functionality with this component, but I was wondering...is there a way to limit the number of nested levels from root that can set as a config option?
Thanks!
Hi.
Currently there isn't a way, but I might refactor the drag and drop and add this option in the coming weeks.
I will update this thread
Sorry there is a way to do this by overriding actionMapping.mouse.drop action.
then move the node only in certain conditions. Something like this:
actionMapping: {
mouse: {
drop: (tree:TreeModel, node:TreeNode, $event:any, to:{ node:TreeNode, index: number }) => {
if (node.level < X) {
TREE_ACTIONS.MOVE_NODE(tree, node, $event, to);
}
else {
alert('cannot drop here');
}
}
}
}
Please try and let me know
Hey @adamkleingit, Sorry it's taken me so long to respond to your response, but I did try out what you suggested and it's doing exactly what I want it to. Thankyou so much :)
Sorry there is a way to do this by overriding actionMapping.mouse.drop action.
then move the node only in certain conditions. Something like this:
actionMapping: { mouse: { drop: (tree:TreeModel, node:TreeNode, $event:any, to:{ node:TreeNode, index: number }) => { if (node.level < X) { TREE_ACTIONS.MOVE_NODE(tree, node, $event, to); } else { alert('cannot drop here'); } } } }Please try and let me know
it's doing exactly what I want it to !!!!!!!! thank you!!!!!!!!
Most helpful comment
Sorry there is a way to do this by overriding actionMapping.mouse.drop action.
then move the node only in certain conditions. Something like this:
Please try and let me know