Function(treeId, treeNode)setting.callback.beforeExpand

Overview[ depends on jquery.ztree.core js ]

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

Default: null

Function Parameter Descriptions

treeIdString

zTree unique identifier: treeId, easy for users to control.

treeNodeJSON

JSON data object of the node which will be expanded

Return Boolean

return true or false

If return false, zTree will not expand node, and will not trigger the 'onExpand' callback.

Examples of setting & function

1. disabled to expand node which is collapsed

function zTreeBeforeExpand(treeId, treeNode) {
    return false;
};
var setting = {
	callback: {
		beforeExpand: zTreeBeforeExpand
	}
};
......