zTreeObj.getCheckedNodes.html 1.6 KB

123456789101112131415161718192021222324252627282930
  1. <div class="apiDetail">
  2. <div>
  3. <h2><span>Function(checked)</span><span class="path">zTreeObj.</span>getCheckedNodes</h2>
  4. <h3>Overview<span class="h3_info">[ depends on <span
  5. class="highlight_green">jquery.ztree.excheck</span> js ]</span></h3>
  6. <div class="desc">
  7. <p></p>
  8. <div class="longdesc">
  9. <p>Get the collection of nodes which be checked or unchecked. It is valid when <span
  10. class="highlight_red">[setting.check.enable = true]</span></p>
  11. <p class="highlight_red">Please use zTree object to executing the method.</p>
  12. </div>
  13. </div>
  14. <h3>Function Parameter Descriptions</h3>
  15. <div class="desc">
  16. <h4><b>checked</b><span>Boolean</span></h4>
  17. <p>checked = true means: get the collection of nodes which be checked</p>
  18. <p>checked = false means: get the collection of nodes which be unchecked</p>
  19. <p class="highlight_red">If this parameter is omitted, it is same as 'checked = true'</p>
  20. <p class="highlight_red">Don't get the nodes which 'nocheck' attribute is true.</p>
  21. <h4 class="topLine"><b>Return </b><span>Array(JSON)</span></h4>
  22. <p>return the collection of nodes which be checked or unchecked. (Array)</p>
  23. </div>
  24. <h3>Examples of function</h3>
  25. <h4>1. Get the collection of nodes which be checked.</h4>
  26. <pre xmlns=""><code>var treeObj = $.fn.zTree.getZTreeObj("tree");
  27. var nodes = treeObj.getCheckedNodes(true);
  28. </code></pre>
  29. </div>
  30. </div>