setting.callback.beforeDblClick.html 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. <div class="apiDetail">
  2. <div>
  3. <h2><span>Function(treeId, treeNode)</span><span class="path">setting.callback.</span>beforeDblClick</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>Specify callback function, executed before the 'onDblClick' callback, The return value controls the
  10. 'onDblClick' callback.</p>
  11. <p>Default: null</p>
  12. </div>
  13. </div>
  14. <h3>Function Parameter Descriptions</h3>
  15. <div class="desc">
  16. <h4><b>treeId</b><span>String</span></h4>
  17. <p>zTree unique identifier: <b class="highlight_red">treeId</b>.</p>
  18. <h4 class="topLine"><b>treeNode</b><span>JSON</span></h4>
  19. <p>JSON data object of the node which is double clicked</p>
  20. <p class="highlight_red">If the DOM which dblclicked isn't a node, it will return null.</p>
  21. <h4 class="topLine"><b>Return </b><span>Boolean</span></h4>
  22. <p>return true or false</p>
  23. <p class="highlight_red">If return false, ztree will not trigger the 'onDblClick' callback, no effect on
  24. other operations.</p>
  25. <p class="highlight_red">This callback function does not affect the auto expand of the parent node , please
  26. refer to setting.view.dblClickExpand properties.</p>
  27. </div>
  28. <h3>Examples of setting & function</h3>
  29. <h4>1. disable to trigger the 'onDblClick' callback</h4>
  30. <pre xmlns=""><code>function myBeforeDblClick(treeId, treeNode) {
  31. return false;
  32. };
  33. var setting = {
  34. callback: {
  35. beforeDblClick: myBeforeDblClick
  36. }
  37. };
  38. ......</code></pre>
  39. </div>
  40. </div>