setting.callback.onRightClick.html 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. <div class="apiDetail">
  2. <div>
  3. <h2><span>Function(event, treeId, treeNode)</span><span class="path">setting.callback.</span>onRightClick</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>Callback for mouse right click node.</p>
  10. <p class="highlight_red">If you set 'setting.callback.beforeRightClick',and return false, zTree will not
  11. trigger the 'onRightClick' callback.</p>
  12. <p class="highlight_red">If you set 'setting.callback.onRightClick', zTree will shield the browser
  13. context menu when mouse right click on zTree.</p>
  14. <p>Default: null</p>
  15. </div>
  16. </div>
  17. <h3>Function Parameter Descriptions</h3>
  18. <div class="desc">
  19. <h4><b>event</b><span>js event Object</span></h4>
  20. <p>event Object</p>
  21. <h4 class="topLine"><b>treeId</b><span>String</span></h4>
  22. <p>zTree unique identifier: <b class="highlight_red">treeId</b>.</p>
  23. <h4 class="topLine"><b>treeNode</b><span>JSON</span></h4>
  24. <p>JSON data object of the node which is mouse right clicked</p>
  25. <p class="highlight_red">If the DOM which mouse right clicked isn't a node, it will return null.</p>
  26. </div>
  27. <h3>Examples of setting & function</h3>
  28. <h4>1. When mouse right click node, alert info about 'tId' and 'name'.</h4>
  29. <pre xmlns=""><code>function myOnRightClick(event, treeId, treeNode) {
  30. alert(treeNode ? treeNode.tId + ", " + treeNode.name : "isRoot");
  31. };
  32. var setting = {
  33. callback: {
  34. onRightClick: myOnRightClick
  35. }
  36. };
  37. ......</code></pre>
  38. </div>
  39. </div>