setting.view.showIcon.html 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. <div class="apiDetail">
  2. <div>
  3. <h2><span>Boolean / Function(treeId, treeNode)</span><span class="path">setting.view.</span>showIcon</h2>
  4. <h3>Overview<span class="h3_info">[ depends on <span class="highlight_green">jquery.ztree.core</span> js ]</span></h3>
  5. <div class="desc">
  6. <p></p>
  7. <div class="longdesc">
  8. <p>Set to show or hide node icon.</p>
  9. <p>Default: true</p>
  10. </div>
  11. </div>
  12. <h3>Boolean Format</h3>
  13. <div class="desc">
  14. <p> true means: show node icon.</p>
  15. <p> false means: hide node icon.</p>
  16. </div>
  17. <h3>Function Parameter Descriptions</h3>
  18. <div class="desc">
  19. <h4><b>treeId</b><span>String</span></h4>
  20. <p>zTree unique identifier: <b class="highlight_red">treeId</b>, easy for users to control.</p>
  21. <h4 class="topLine"><b>treeNode</b><span>JSON</span></h4>
  22. <p>JSON data object of the node which need to show icon.</p>
  23. <h4 class="topLine"><b>Return </b><span>Boolean</span></h4>
  24. <p>Return value is same as 'Boolean Format'</p>
  25. </div>
  26. <h3>Examples of setting & function</h3>
  27. <h4>1. Hide node icon</h4>
  28. <pre xmlns=""><code>var setting = {
  29. view: {
  30. showIcon: false
  31. }
  32. };
  33. ......</code></pre>
  34. <h4>2. Hide node icon which level=2</h4>
  35. <pre xmlns=""><code>function showIconForTree(treeId, treeNode) {
  36. return treeNode.level != 2;
  37. };
  38. var setting = {
  39. view: {
  40. showIcon: showIconForTree
  41. }
  42. };
  43. ......</code></pre>
  44. </div>
  45. </div>