setting.view.showTitle.html 2.0 KB

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