When drag one node to the target node, set whether to allow the node to be the target node's child. It is valid when [setting.edit.enable = true]
If the target node is root, so zTree will only trigger 'inner' and not trigger 'prev / next'.
This function mainly for the appropriate limit drag and drop (auxiliary arrow), it requires a combination of 'prev, next' together, to achieve full functionality.
Default: true
true means: allow the node to be the target node's child.
false means: don't allow the node to be the target node's child.
zTree unique identifier: treeId.
A collection of the nodes which has been dragged
JSON data object of the target node which treeNodes are draged over.
If the treeNodes will be root node, the targetNode = null
return true or false
var setting = {
edit: {
enable: true,
drag: {
prev: true,
next: true,
inner: false
}
}
};
......
function canInner(treeId, nodes, targetNode) {
return !(targetNode && targetNode.level === 0);
}
var setting = {
edit: {
enable: true,
drag: {
prev: true,
next: true,
inner: canInner
}
}
};
......