No Description

treeNode.getCheckStatus.html 2.7KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. <div class="apiDetail">
  2. <div>
  3. <h2><span>Function()</span><span class="path">treeNode.</span>getCheckStatus</h2>
  4. <h3>概述<span class="h3_info">[ 依赖 <span class="highlight_green">jquery.ztree.excheck</span> 扩展 js ]</span></h3>
  5. <div class="desc">
  6. <p></p>
  7. <div class="longdesc">
  8. <p>获取节点 checkbox / radio 半勾选状态。<span class="highlight_red">[setting.check.enable = true 时有效]</span></p>
  9. <p class="highlight_red">初始化节点数据时,由 zTree 增加此属性,请勿提前赋值</p>
  10. </div>
  11. </div>
  12. <h3>Function 参数说明</h3>
  13. <div class="desc">
  14. <h4><b>返回值</b><span>JSON</span></h4>
  15. <pre xmlns=""><code>{
  16. checked: true, //等同于 treeNode.checked
  17. half: true //规则见下表
  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>treeNode 举例</h3>
  58. <h4>1. 获取第一个根节点的半选状态</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>