treeNode.checked.html 2.0 KB

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