treeNode.isParent.html 1.4 KB

1234567891011121314151617181920212223242526272829303132
  1. <div class="apiDetail">
  2. <div>
  3. <h2><span>Boolean</span><span class="path">treeNode.</span>isParent</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>Judge whether the node is the parent node.</p>
  10. <p class="highlight_red">1. When zTree initialize the node data, the node which has children is set to
  11. true, otherwise false.</p>
  12. <p class="highlight_red">2. When zTree initialize the node data, if set treeNode.isParent to true, the
  13. node will be set to be parent node.</p>
  14. <p class="highlight_red">3. In order to solve the problem of someone make json data, supporting "false",
  15. "true" format of the data string.</p>
  16. </div>
  17. </div>
  18. <h3>Boolean Format</h3>
  19. <div class="desc">
  20. <p> true means: the node is parent node.</p>
  21. <p> false means: the node is not parent node.</p>
  22. </div>
  23. <h3>Examples of treeNode</h3>
  24. <h4>1. Judge whether the first selected node is the parent node.</h4>
  25. <pre xmlns=""><code>var treeObj = $.fn.zTree.getZTreeObj("tree");
  26. var sNodes = treeObj.getSelectedNodes();
  27. if (sNodes.length > 0) {
  28. var isParent = sNodes[0].isParent;
  29. }
  30. </code></pre>
  31. </div>
  32. </div>