setting.callback.beforeDragOpen.html 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637
  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 class="highlight_green">jquery.ztree.exedit</span> js ]</span></h3>
  5. <div class="desc">
  6. <p></p>
  7. <div class="longdesc">
  8. <p>Used to capture the event when drag node to collapsed parent node, zTree based on return value to determine whether to auto expand parent node.</p>
  9. <p>Default: null</p>
  10. </div>
  11. </div>
  12. <h3>Function Parameter Descriptions</h3>
  13. <div class="desc">
  14. <h4><b>treeId</b><span>String</span></h4>
  15. <p>zTree unique identifier: <b class="highlight_red">treeId</b>, the tree is what the treeNode(parent node) is belong to, easy for users to control.</p>
  16. <h4 class="topLine"><b>treeNode</b><span>JSON</span></h4>
  17. <p>JSON data object of the parent node which will be auto expanded</p>
  18. <h4 class="topLine"><b>Return </b><span>Boolean</span></h4>
  19. <p>return true or false</p>
  20. <p class="highlight_red">If return false, zTree will not auto expand parent node.</p>
  21. </div>
  22. <h3>Examples of setting & function</h3>
  23. <h4>1. disable to auto expand parent node.</h4>
  24. <pre xmlns=""><code>function zTreeBeforeDragOpen(treeId, treeNode) {
  25. return false;
  26. };
  27. var setting = {
  28. edit: {
  29. enable: true
  30. },
  31. callback: {
  32. beforeDragOpen: zTreeBeforeDragOpen
  33. }
  34. };
  35. ......</code></pre>
  36. </div>
  37. </div>