treeNode.getCheckStatus.html 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. <div class="apiDetail">
  2. <div>
  3. <h2><span>Function()</span><span class="path">treeNode.</span>getCheckStatus</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>Get the node's half-checked status of checkbox or radio. It is valid when <span class="highlight_red">[setting.check.enable = true]</span></p>
  9. <p class="highlight_red">Do not initialize or modify it, it is created by the zTree.</p>
  10. </div>
  11. </div>
  12. <h3>Function Parameter Descriptions</h3>
  13. <div class="desc">
  14. <h4><b>Return</b><span>JSON</span></h4>
  15. <pre xmlns=""><code>{
  16. checked: true, //As same as 'treeNode.checked'
  17. half: true //Rule the table below
  18. }</code></pre>
  19. <table width="100%" border="0" cellspacing="1" cellpadding="0">
  20. <thead>
  21. <tr><td colspan="4">setting.check.checkType = "checkbox"</td></tr>
  22. <tr><td>treeNode.checked</td><td>treeNode.check_Child_State</td><td>treeNode.halfCheck</td><td> half </td></tr>
  23. </thead>
  24. <tbody>
  25. <tr><td>-</td><td>-</td><td>true</td><td>true</td></tr>
  26. <tr><td colspan="4">&nbsp;</td></tr>
  27. <tr><td>true</td><td>-1</td><td>false</td><td>false</td></tr>
  28. <tr><td>true</td><td>0</td><td>false</td><td>true</td></tr>
  29. <tr><td>true</td><td>1</td><td>false</td><td>true</td></tr>
  30. <tr><td>true</td><td>2</td><td>false</td><td>false</td></tr>
  31. <tr><td colspan="4">&nbsp;</td></tr>
  32. <tr><td>false</td><td>-1</td><td>false</td><td>false</td></tr>
  33. <tr><td>false</td><td>0</td><td>false</td><td>false</td></tr>
  34. <tr><td>false</td><td>1</td><td>false</td><td>true</td></tr>
  35. <tr><td>false</td><td>2</td><td>false</td><td>true</td></tr>
  36. </tbody>
  37. </table>
  38. <br/>
  39. <table width="100%" border="0" cellspacing="1" cellpadding="0">
  40. <thead>
  41. <tr><td colspan="4">setting.check.checkType = "radio"</td></tr>
  42. <tr><td>treeNode.checked</td><td>treeNode.check_Child_State</td><td>treeNode.halfCheck</td><td> half </td></tr>
  43. </thead>
  44. <tbody>
  45. <tr><td>-</td><td>-</td><td>true</td><td>true</td></tr>
  46. <tr><td colspan="4">&nbsp;</td></tr>
  47. <tr><td>true</td><td>-1</td><td>false</td><td>false</td></tr>
  48. <tr><td>true</td><td>0</td><td>false</td><td>false</td></tr>
  49. <tr><td>true</td><td>2</td><td>false</td><td>true</td></tr>
  50. <tr><td colspan="4">&nbsp;</td></tr>
  51. <tr><td>false</td><td>-1</td><td>false</td><td>false</td></tr>
  52. <tr><td>false</td><td>0</td><td>false</td><td>false</td></tr>
  53. <tr><td>false</td><td>2</td><td>false</td><td>true</td></tr>
  54. </tbody>
  55. </table>
  56. </div>
  57. <h3>Examples of treeNode</h3>
  58. <h4>1. Get the first root node's half-checked status</h4>
  59. <pre xmlns=""><code>var treeObj = $.fn.zTree.getZTreeObj("tree");
  60. var halfCheck = treeObj.getNodes()[0].getCheckStatus();
  61. </code></pre>
  62. </div>
  63. </div>