1 <div class="apiDetail">
\r
3 <h2><span class="path">setting.callback.</span>onAsyncError</h2>
\r
4 <h2><span>Function(event, treeId, treeNode, XMLHttpRequest, textStatus, errorThrown)</span> </h2>
\r
5 <h3>Overview<span class="h3_info">[ depends on <span class="highlight_green">jquery.ztree.core</span> js ]</span></h3>
\r
8 <div class="longdesc">
\r
9 <p>Used to capture the error event when execute ajax.</p>
\r
10 <p class="highlight_red">If you set 'setting.callback.beforeAsync',and return false, zTree will not execute ajax, and will not trigger the 'onAsyncSuccess / onAsyncError' callback.</p>
\r
11 <p>Default: null</p>
\r
14 <h3>Function Parameter Descriptions</h3>
\r
16 <h4><b>event</b><span>js event Object</span></h4>
\r
18 <h4 class="topLine"><b>treeId</b><span>String</span></h4>
\r
19 <p>zTree unique identifier: <b class="highlight_red">treeId</b>, easy for users to control.</p>
\r
20 <h4 class="topLine"><b>treeNode</b><span>JSON</span></h4>
\r
21 <p>JSON data object of the parent node</p>
\r
22 <p class="highlight_red">When load root nodes, treeNode = null</p>
\r
23 <h4 class="topLine"><b>XMLHttpRequest</b><span>String</span></h4>
\r
24 <p>XMLHttpRequest Object, please refer to JQuery API documentation.</p>
\r
25 <h4 class="topLine"><b>textStatus</b><span>String</span></h4>
\r
26 <p>a string categorizing the status of the request("success", "error"...), please refer to JQuery API documentation.</p>
\r
27 <h4 class="topLine"><b>errorThrown</b><span>String</span></h4>
\r
28 <p>eWhen an HTTP error occurs, errorThrown receives the textual portion of the HTTP status, please refer to JQuery API documentation.</p>
\r
30 <h3>Examples of setting & function</h3>
\r
31 <h4>1. When execute ajax make error, alert message.</h4>
\r
32 <pre xmlns=""><code>function zTreeOnAsyncError(event, treeId, treeNode, XMLHttpRequest, textStatus, errorThrown) {
\r
33 alert(XMLHttpRequest);
\r
37 onAsyncError: zTreeOnAsyncError
\r