treeNode.parentTId.html 1.2 KB

123456789101112131415161718192021222324252627
  1. <div class="apiDetail">
  2. <div>
  3. <h2><span>String</span><span class="path">treeNode.</span>parentTId</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>The unique identifier of node's parent node.</p>
  9. <p class="highlight_red">1. zTree v3.x using 'parentTId' replaced the original 'parentNode' attribute, and increased getParentNode () method, in order to avoid the original 'parentNode' cause the clone () method infinite loop.</p>
  10. <p class="highlight_red">2. Do not initialize or modify it, it is created by the zTree.</p>
  11. </div>
  12. </div>
  13. <h3>String Format</h3>
  14. <div class="desc">
  15. <p>String object of node's parent node's tId. please see API about 'treeNode.tId'</p>
  16. <p class="highlight_red">If treeNode is root node, parentTId is null.</p>
  17. </div>
  18. <h3>Examples of treeNode</h3>
  19. <h4>1. Get the first selected node's parent node's tId</h4>
  20. <pre xmlns=""><code>var treeObj = $.fn.zTree.getZTreeObj("tree");
  21. var sNodes = treeObj.getSelectedNodes();
  22. if (sNodes.length > 0) {
  23. var parentTId = sNodes[0].parentTId;
  24. }
  25. </code></pre>
  26. </div>
  27. </div>