CLIENT GUI Framework
[vnfsdk/refrepo.git] / portal-common / src / main / webapp / common / thirdparty / zTree / api / en / setting.callback.onAsyncError.html
1 <div class="apiDetail">\r
2 <div>\r
3         <h2><span class="path">setting.callback.</span>onAsyncError</h2>\r
4         <h2><span>Function(event, treeId, treeNode, XMLHttpRequest, textStatus, errorThrown)</span>&nbsp;</h2>\r
5         <h3>Overview<span class="h3_info">[ depends on <span class="highlight_green">jquery.ztree.core</span> js ]</span></h3>\r
6         <div class="desc">\r
7                 <p></p>\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
12                 </div>\r
13         </div>\r
14         <h3>Function Parameter Descriptions</h3>\r
15         <div class="desc">\r
16         <h4><b>event</b><span>js event Object</span></h4>\r
17         <p>event Object</p>\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
29         </div>\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
34 };\r
35 var setting = {\r
36         callback: {\r
37                 onAsyncError: zTreeOnAsyncError\r
38         }\r
39 };\r
40 ......</code></pre>\r
41 </div>\r
42 </div>