Specify callback function to be called before the drag node callback, The return value controls whether the drag node callback will execute.
Default: null
zTree unique identifier: treeId, the id of the containing tree.
A collection of the nodes being dragged
v3.x allows the drag and drop of multiple sibling nodes, so this parameter's type is changed to Array(JSON).
If the selected nodes aren't sibling nodes, you can only drag one node.
return true or false
If return false, zTree will abort the drag and drop, and will not trigger the 'onDrag / beforeDrop / onDrop' sequence of callbacks.
function myBeforeDrag(treeId, treeNodes) {
return false;
};
var setting = {
edit: {
enable: true
},
callback: {
beforeDrag: myBeforeDrag
}
};
......