treeNode.checked.html 1.6 KB

1234567891011121314151617181920212223242526272829303132
  1. <div class="apiDetail">
  2. <div>
  3. <h2><span>Boolean</span><span class="path">treeNode.</span>checked</h2>
  4. <h3>Overview<span class="h3_info">[ depends on <span class="highlight_green">jquery.ztree.excheck</span> js ]</span></h3>
  5. <div class="desc">
  6. <p></p>
  7. <div class="longdesc">
  8. <p>The checked status about node's checkbox or radio. It is valid when <span class="highlight_red">[setting.check.enable = true & treeNode.nocheck = false]</span></p>
  9. <p class="highlight_red">1. If change the 'checked' to other attribute, please set the 'setting.data.key.checked' attribute.</p>
  10. <p class="highlight_red">2. If you create node data, and set 'checked' attribute to true, zTree will check this node's checkbox or radio when zTree is initialized.</p>
  11. <p class="highlight_red">3. Use the treeObj.checkNode or checkAllNodes or updateNode method, you can check or uncheck the node. Please see the API about these methods.</p>
  12. <p class="highlight_red">4. zTree support identification string 'true' & 'false'.</p>
  13. <p>Default: false</p>
  14. </div>
  15. </div>
  16. <h3>Boolean Format</h3>
  17. <div class="desc">
  18. <p>true means: check the checkbox or radio when zTree is initialized.</p>
  19. <p>false means: uncheck the checkbox or radio when zTree is initialized.</p>
  20. </div>
  21. <h3>Examples of treeNode</h3>
  22. <h4>1. check the checkbox when zTree is initialized</h4>
  23. <pre xmlns=""><code>var nodes = [
  24. { "id":1, "name":"test1", checked:true },
  25. { "id":2, "name":"test2", checked:true }
  26. ]</code></pre>
  27. <h4>2. Get the checked status of the first root node</h4>
  28. <pre xmlns=""><code>var treeObj = $.fn.zTree.getZTreeObj("tree");
  29. var checked = treeObj.getNodes()[0].checked;
  30. </code></pre>
  31. </div>
  32. </div>