No Description

setting.view.showIcon.html 1.3KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. <div class="apiDetail">
  2. <div>
  3. <h2><span>Boolean / Function(treeId, treeNode)</span><span class="path">setting.view.</span>showIcon</h2>
  4. <h3>概述<span class="h3_info">[ 依赖 <span class="highlight_green">jquery.ztree.core</span> 核心 js ]</span></h3>
  5. <div class="desc">
  6. <p></p>
  7. <div class="longdesc">
  8. <p>设置 zTree 是否显示节点的图标。</p>
  9. <p>默认值:true</p>
  10. </div>
  11. </div>
  12. <h3>Boolean 格式说明</h3>
  13. <div class="desc">
  14. <p> true / false 分别表示 显示 / 隐藏 图标</p>
  15. </div>
  16. <h3>Function 参数说明</h3>
  17. <div class="desc">
  18. <h4><b>treeId</b><span>String</span></h4>
  19. <p>对应 zTree 的 <b class="highlight_red">treeId</b>,便于用户操控</p>
  20. <h4 class="topLine"><b>treeNode</b><span>JSON</span></h4>
  21. <p>需要设置是否显示图标的节点 JSON 数据对象</p>
  22. <h4 class="topLine"><b>返回值</b><span>Boolean</span></h4>
  23. <p>返回值同 Boolean 格式的数据</p>
  24. </div>
  25. <h3>setting & function 举例</h3>
  26. <h4>1. 设置 zTree 不显示图标</h4>
  27. <pre xmlns=""><code>var setting = {
  28. view: {
  29. showIcon: false
  30. }
  31. };
  32. ......</code></pre>
  33. <h4>2. 设置 zTree 仅仅 level=2 的节点不显示图标</h4>
  34. <pre xmlns=""><code>function showIconForTree(treeId, treeNode) {
  35. return treeNode.level != 2;
  36. };
  37. var setting = {
  38. view: {
  39. showIcon: showIconForTree
  40. }
  41. };
  42. ......</code></pre>
  43. </div>
  44. </div>