treeNode.getPath.html 1.1 KB

123456789101112131415161718192021222324252627
  1. <div class="apiDetail">
  2. <div>
  3. <h2><span>Function()</span><span class="path">treeNode.</span>getPath</h2>
  4. <h3>Overview<span class="h3_info">[ depends on <span
  5. class="highlight_green">jquery.ztree.core</span> js ]</span></h3>
  6. <div class="desc">
  7. <p></p>
  8. <div class="longdesc">
  9. <p>Get the treeNode's all parent nodes. (Include itself)</p>
  10. <p class="highlight_red">Do not initialize or modify it, it is created by the zTree.</p>
  11. </div>
  12. </div>
  13. <h3>Function Parameter Descriptions</h3>
  14. <div class="desc">
  15. <h4><b>Return</b><span>Array (JSON)</span></h4>
  16. <p>Array of treeNode's all parent nodes. (Include itself)</p>
  17. </div>
  18. <h3>Examples of treeNode</h3>
  19. <h4>1. Get the first selected node's all parent nodes.</h4>
  20. <pre xmlns=""><code>var treeObj = $.fn.zTree.getZTreeObj("tree");
  21. var sNodes = treeObj.getSelectedNodes();
  22. if (sNodes.length > 0) {
  23. var node = sNodes[0].getPath();
  24. }
  25. </code></pre>
  26. </div>
  27. </div>