zTreeObj.reAsyncChildNodes.html 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. <div class="apiDetail">
  2. <div>
  3. <h2><span>Function(parentNode, reloadType, isSilent, callback)</span><span class="path">zTreeObj.</span>reAsyncChildNodes
  4. </h2>
  5. <h3>Overview<span class="h3_info">[ depends on <span
  6. class="highlight_green">jquery.ztree.core</span> js ]</span></h3>
  7. <div class="desc">
  8. <p></p>
  9. <div class="longdesc">
  10. <p>Forced asynchronous loading child nodes of parent node. It is valid when <span class="highlight_red">[setting.async.enable = true]</span>
  11. </p>
  12. <p class="highlight_red">You can use this method to reload child nodes.</p>
  13. <p class="highlight_red">Please use zTree object to executing the method.</p>
  14. </div>
  15. </div>
  16. <h3>Function Parameter Descriptions</h3>
  17. <div class="desc">
  18. <h4><b>parentNode</b><span>JSON</span></h4>
  19. <p>The parent node which will asynchronous loading child nodes.</p>
  20. <p class="highlight_red">1. If parentNode = null, it is same as reload root nodes.</p>
  21. <p class="highlight_red">2. If parentNode.isParent = false, don't load nodes.</p>
  22. <p class="highlight_red">3. Please ensure that this data object is an internal node data object in
  23. zTree.</p>
  24. <h4 class="topLine"><b>reloadType</b><span>String</span></h4>
  25. <p>reloadType = "refresh" means: reload child nodes.</p>
  26. <p>reloadType != "refresh" means: append to load child nodes.</p>
  27. <h4 class="topLine"><b>isSilent</b><span>Boolean</span></h4>
  28. <p>Set whether to automatically expand the parent node, after load nodes.</p>
  29. <p>isSilent = true means: don't auto expand the parent node. Otherwise auto expand.</p>
  30. <h4 class="topLine"><b>callback</b><span>function</span></h4>
  31. <p>zTree will trigger this callback() function after reAsyncChildNodes()</p>
  32. <h4 class="topLine"><b>Return </b><span>none</span></h4>
  33. <p>no return value</p>
  34. </div>
  35. <h3>Examples of function</h3>
  36. <h4>1. reload root nodes</h4>
  37. <pre xmlns=""><code>var treeObj = $.fn.zTree.getZTreeObj("tree");
  38. treeObj.reAsyncChildNodes(null, "refresh");
  39. </code></pre>
  40. <h4>2. reload the first selected node's child nodes.</h4>
  41. <pre xmlns=""><code>var treeObj = $.fn.zTree.getZTreeObj("tree");
  42. var nodes = treeObj.getSelectedNodes();
  43. if (nodes.length>0) {
  44. treeObj.reAsyncChildNodes(nodes[0], "refresh");
  45. }
  46. </code></pre>
  47. </div>
  48. </div>