Function(treeId, treeNode)setting.callback.beforeAsync

Overview[ depends on jquery.ztree.core js ]

This callback is made before zTree makes an ajax request, giving you an opportunity to decide if it should proceed or not. Return false to prevent zTree from sending the ajax request.

Default: null

Function Parameter Descriptions

treeIdString

zTree unique identifier: treeId.

treeNodeJSON

JSON data object of the parent node

When asynchronously loading the root, treeNode = null

Return Boolean

return true or false

If the function returns false, zTree will not send the ajax request, and will not trigger the 'onAsyncSuccess / onAsyncError' callback.

Examples of setting & function

1. If the parent node's attribute 'id' is 1, don't send the ajax request.

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