zTreeObj.reAsyncChildNodes.html 2.0 KB

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