setting.edit.removeTitle.html 2.0 KB

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