setting.edit.removeTitle.html 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. <div class="apiDetail">
  2. <div>
  3. <h2><span>String / Function(treeId, treeNode)</span><span class="path">setting.edit.</span>removeTitle</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>the title of the remove button DOM. It is valid when <span class="highlight_red">[setting.edit.enable = true & setting.edit.showRemoveBtn = true]</span></p>
  9. <p>Default: "remove"</p>
  10. </div>
  11. </div>
  12. <h3>String Format</h3>
  13. <div class="desc">
  14. <p>When the mouse over the remove button, the browser auto pop-up message content.</p>
  15. </div>
  16. <h3>Function Parameter Descriptions</h3>
  17. <div class="desc">
  18. <h4><b>treeId</b><span>String</span></h4>
  19. <p>zTree unique identifier: <b class="highlight_red">treeId</b>, easy for users to control.</p>
  20. <h4 class="topLine"><b>treeNode</b><span>JSON</span></h4>
  21. <p>JSON data object of the node which show the remove button</p>
  22. <h4 class="topLine"><b>Return </b><span>String</span></h4>
  23. <p>Return value is same as 'String Format'</p>
  24. </div>
  25. <h3>Examples of setting & function</h3>
  26. <h4>1. Set title is 'remove the node' about all the remove button</h4>
  27. <pre xmlns=""><code>var setting = {
  28. edit: {
  29. enable: true,
  30. showRemoveBtn: true,
  31. removeTitle: "remove the node"
  32. }
  33. };
  34. ......</code></pre>
  35. <h4>2. Set title is 'remove the parent node' about the parent node, and is 'remove the leaf node' about the leaf node</h4>
  36. <pre xmlns=""><code>function setRemoveTitle(treeId, treeNode) {
  37. return treeNode.isParent ? "remove the parent node":"remove the leaf node";
  38. }
  39. var setting = {
  40. edit: {
  41. enable: true,
  42. showRemoveBtn: true,
  43. removeTitle: setRemoveTitle
  44. }
  45. };
  46. ......</code></pre>
  47. </div>
  48. </div>