Function(treeId, treeNodes)setting.callback.beforeDrag

Overview[ depends on jquery.ztree.exedit js ]

Used to capture the event before drag node, zTree based on return value to determine whether to start to drag node.

Default: null

Function Parameter Descriptions

treeIdString

zTree unique identifier: treeId, the tree is what the treeNodes are belong to, easy for users to control.

treeNodesArray(JSON)

A collection of the nodes which will be dragged

v3.x allows drag and drop multiple sibling nodes, so this parameter is modified to Array(JSON).

If the selected nodes aren't the sibling nodes, you can only drag one node which mouse over.

Return Boolean

return true or false

If return false, zTree will stop drag, and will not trigger the 'onDrag / beforeDrop / onDrop' callback.

Examples of setting & function

1. disable to drag all node

function zTreeBeforeDrag(treeId, treeNodes) {
    return false;
};
var setting = {
	edit: {
		enable: true
	},
	callback: {
		beforeDrag: zTreeBeforeDrag
	}
};
......