setting.callback.beforeDragOpen.html 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. <div class="apiDetail">
  2. <div>
  3. <h2><span>Function(treeId, treeNode)</span><span class="path">setting.callback.</span>beforeDragOpen</h2>
  4. <h3>Overview<span class="h3_info">[ depends on <span
  5. class="highlight_green">jquery.ztree.exedit</span> js ]</span></h3>
  6. <div class="desc">
  7. <p></p>
  8. <div class="longdesc">
  9. <p>Callback executed before drag node to collapsed parent node, The return value controls the auto
  10. expand behaviour of the parent node.</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>, the tree is what the treeNode(parent node)
  18. is belong to.</p>
  19. <h4 class="topLine"><b>treeNode</b><span>JSON</span></h4>
  20. <p>JSON data object of the parent node which will be auto expanded</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 auto expand parent node.</p>
  24. </div>
  25. <h3>Examples of setting & function</h3>
  26. <h4>1. disable to auto expand parent node.</h4>
  27. <pre xmlns=""><code>function myBeforeDragOpen(treeId, treeNode) {
  28. return false;
  29. };
  30. var setting = {
  31. edit: {
  32. enable: true
  33. },
  34. callback: {
  35. beforeDragOpen: myBeforeDragOpen
  36. }
  37. };
  38. ......</code></pre>
  39. </div>
  40. </div>