setting.callback.onAsyncError

Function(event, treeId, treeNode, XMLHttpRequest, textStatus, errorThrown) 

Overview[ depends on jquery.ztree.core js ]

Used to capture the error event when execute ajax.

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

Default: null

Function Parameter Descriptions

eventjs event Object

event Object

treeIdString

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

treeNodeJSON

JSON data object of the parent node

When load root nodes, treeNode = null

XMLHttpRequestString

XMLHttpRequest Object, please refer to JQuery API documentation.

textStatusString

a string categorizing the status of the request("success", "error"...), please refer to JQuery API documentation.

errorThrownString

eWhen an HTTP error occurs, errorThrown receives the textual portion of the HTTP status, please refer to JQuery API documentation.

Examples of setting & function

1. When execute ajax make error, alert message.

function zTreeOnAsyncError(event, treeId, treeNode, XMLHttpRequest, textStatus, errorThrown) {
    alert(XMLHttpRequest);
};
var setting = {
	callback: {
		onAsyncError: zTreeOnAsyncError
	}
};
......