Boolean / Function(treeId, treeNodes, targetNode)setting.edit.drag.next

Overview[ depends on jquery.ztree.exedit js ]

When drag one node to the target node, set whether to allow the node to be the target node's next sibling. 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, inner' together, to achieve full functionality.

Default: true

Boolean Format

true means: allow the node to be the target node's next sibling.

false means: don't allow the node to be the target node's next sibling.

Function Parameter Descriptions

treeIdString

zTree unique identifier: treeId.

treeNodesArray(JSON)

A collection of the nodes which has been dragged

targetNodeJSON

JSON data object of the target node which treeNodes are draged over.

Return Boolean

return true or false

Examples of setting & function

1. disable to drag the node to the target node's next sibling.

var setting = {
	edit: {
		enable: true,
		drag: {
			prev: true,
			next: false,
			inner: true
		}
	}
};
......

2. disable to drag the node to be all of the parent nodes's next sibling.

function canNext(treeId, nodes, targetNode) {
	return !targetNode.isParent;
}
var setting = {
	edit: {
		enable: true,
		drag: {
			prev: true,
			next: canNext,
			inner: true
		}
	}
};
......