treeNode.icon.html 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. <div class="apiDetail">
  2. <div>
  3. <h2><span>String</span><span class="path">treeNode.</span>icon</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>URL path of node's custom icon.</p>
  10. <p class="highlight_red">1. If you only set the 'icon' attribute to parent node, the parent node will
  11. only show one icon when it is expanded or collapsed.</p>
  12. <p class="highlight_red">2. If you need to show two icons when it is expanded or collapsed, please set
  13. the 'treeNode.iconOpen' and 'treeNode.iconClose' attribute.</p>
  14. <p class="highlight_red">3. If you need to use css to set the custom icon, please set the
  15. 'treeNode.iconSkin' attribute.</p>
  16. <p>Default: undefined</p>
  17. </div>
  18. </div>
  19. <h3>String Format</h3>
  20. <div class="desc">
  21. <p>Icon image url can be a relative path or absolute path.</p>
  22. <p class="highlight_red">If use a relative path, please note the relationship between icon image and the
  23. page, ensure the correct image path.</p>
  24. </div>
  25. <h3>Examples of treeNode</h3>
  26. <h4>1. Set the custom icon</h4>
  27. <pre xmlns=""><code>var nodes = [
  28. //Only show one icon when it is expanded or collapsed.
  29. { name:"Parent Node 1", icon:"/img/parent.gif"},
  30. //Show two icons when it is expanded or collapsed.
  31. { name:"Parent Node 2", iconOpen:"/img/open.gif", iconClose:"/img/close.gif"},
  32. //the custom icon for leaf node
  33. { name:"Leaf Node", icon:"/img/leaf.gif"}
  34. ]</code></pre>
  35. </div>
  36. </div>