setting.view.showIcon.html 1.6 KB

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