setting.view.showTitle.html 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. <div class="apiDetail">
  2. <div>
  3. <h2><span>Boolean / Function(treeId, treeNode)</span><span class="path">setting.view.</span>showTitle</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 the 'title' attribute of node DOM.</p>
  9. <p class="highlight_red">Please see the <span class="highlight_red">setting.data.key.title</span> attribute</p>
  10. <p>Default: true</p>
  11. </div>
  12. </div>
  13. <h3>Boolean Format</h3>
  14. <div class="desc">
  15. <p> true means: show the 'title' attribute of node DOM.</p>
  16. <p> false means: hide the 'title' attribute of node DOM.</p>
  17. <p class="highlight_red">When setting.view.showTitle = true & setting.data.key.title = '', zTree will set the 'setting.data.key.name' attribute to the 'setting.data.key.title'.</p>
  18. </div>
  19. <h3>Function Parameter Descriptions</h3>
  20. <div class="desc">
  21. <h4><b>treeId</b><span>String</span></h4>
  22. <p>zTree unique identifier: <b class="highlight_red">treeId</b>, easy for users to control.</p>
  23. <h4 class="topLine"><b>treeNode</b><span>JSON</span></h4>
  24. <p>JSON data object of the node which need to show title.</p>
  25. <h4 class="topLine"><b>Return </b><span>Boolean</span></h4>
  26. <p>Return value is same as 'Boolean Format'</p>
  27. </div>
  28. <h3>Examples of setting & function</h3>
  29. <h4>1. Hide the 'title' attribute of node DOM.</h4>
  30. <pre xmlns=""><code>var setting = {
  31. view: {
  32. showTitle: false
  33. }
  34. };
  35. ......</code></pre>
  36. <h4>2. Hide the 'title' attribute of node DOM which level=2.</h4>
  37. <pre xmlns=""><code>function showTitleForTree(treeId, treeNode) {
  38. return treeNode.level != 2;
  39. };
  40. var setting = {
  41. view: {
  42. showTitle: showTitleForTree
  43. }
  44. };
  45. ......</code></pre>
  46. </div>
  47. </div>