setting.callback.beforeRightClick.html 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. <div class="apiDetail">
  2. <div>
  3. <h2><span>Function(treeId, treeNode)</span><span class="path">setting.callback.</span>beforeRightClick</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>Used to capture the right click event before the 'onRightClick' callback, The return value controls
  10. the 'onRightClick' 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 mouse right clicked</p>
  20. <p class="highlight_red">If the DOM which mouse right clicked 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 'onRightClick' callback, no effect on
  24. other operations.</p>
  25. </div>
  26. <h3>Examples of setting & function</h3>
  27. <h4>1. disable to trigger the 'onRightClick' callback</h4>
  28. <pre xmlns=""><code>function myBeforeRightClick(treeId, treeNode) {
  29. return false;
  30. };
  31. var setting = {
  32. callback: {
  33. beforeRightClick: myBeforeRightClick
  34. }
  35. };
  36. ......</code></pre>
  37. </div>
  38. </div>