setting.view.dblClickExpand.html 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. <div class="apiDetail">
  2. <div>
  3. <h2><span>Boolean / Function(treeId, treeNode)</span><span class="path">setting.view.</span>dblClickExpand</h2>
  4. <h3>概述<span class="h3_info">[ 依赖 <span class="highlight_green">jquery.ztree.core</span> 核心 js ]</span></h3>
  5. <div class="desc">
  6. <p></p>
  7. <div class="longdesc">
  8. <p>双击节点时,是否自动展开父节点的标识</p>
  9. <p>默认值: true</p>
  10. </div>
  11. </div>
  12. <h3>Boolean 格式说明</h3>
  13. <div class="desc">
  14. <p> true / false 分别表示双击节点 切换 / 不切换 展开状态</p>
  15. </div>
  16. <h3>Function 参数说明</h3>
  17. <div class="desc">
  18. <h4><b>treeId</b><span>String</span></h4>
  19. <p>对应 zTree 的 <b class="highlight_red">treeId</b>,便于用户操控</p>
  20. <h4 class="topLine"><b>treeNode</b><span>JSON</span></h4>
  21. <p>需要设置是否双击切换展开状态的节点 JSON 数据对象</p>
  22. <h4 class="topLine"><b>返回值</b><span>Boolean</span></h4>
  23. <p>返回值同 Boolean 格式的数据</p>
  24. </div>
  25. <h3>setting 举例</h3>
  26. <h4>1. 取消默认双击展开父节点的功能</h4>
  27. <pre xmlns=""><code>var setting = {
  28. view: {
  29. dblClickExpand: false
  30. }
  31. };
  32. ......</code></pre>
  33. <h4>2. 设置 zTree 仅仅 level=0 的父节点取消双击展开的功能</h4>
  34. <pre xmlns=""><code>function dblClickExpand(treeId, treeNode) {
  35. return treeNode.level > 0;
  36. };
  37. var setting = {
  38. view: {
  39. dblClickExpand: dblClickExpand
  40. }
  41. };
  42. ......</code></pre>
  43. </div>
  44. </div>