Function(treeId, treeNode)setting.callback.beforeAsync

Overview[ depends on jquery.ztree.core js ]

Used to capture the event before zTree execute ajax, zTree based on return value to determine whether to execute ajax.

Default: null

Function Parameter Descriptions

treeIdString

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

treeNodeJSON

JSON data object of the parent node

When asynchronously loading the root, the treeNode = null

Return Boolean

return true or false

If return false, zTree will not execute ajax, and will not trigger the 'onAsyncSuccess / onAsyncError' callback.

Examples of setting & function

1. If the parent node's attribute 'id' is 1, zTree will not execute ajax.

function zTreeBeforeAsync(treeId, treeNode) {
    return (treeNode.id !== 1);
};
var setting = {
	callback: {
		beforeAsync: zTreeBeforeAsync
	}
};
......