setting.edit.renameTitle.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>renameTitle</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 rename button DOM. It is valid when <span class="highlight_red">[setting.edit.enable = true & setting.edit.showRenameBtn = true]</span></p>
  9. <p>Default: "rename"</p>
  10. </div>
  11. </div>
  12. <h3>String Format</h3>
  13. <div class="desc">
  14. <p>When the mouse over the rename 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>.</p>
  20. <h4 class="topLine"><b>treeNode</b><span>JSON</span></h4>
  21. <p>JSON data object of the node which show the rename 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 'rename the node' about all the rename button</h4>
  27. <pre xmlns=""><code>var setting = {
  28. edit: {
  29. enable: true,
  30. showRenameBtn: true,
  31. renameTitle: "rename the node"
  32. }
  33. };
  34. ......</code></pre>
  35. <h4>2. Set title is 'rename the parent node' about the parent node, and is 'rename the leaf node' about the leaf node</h4>
  36. <pre xmlns=""><code>function setRenameTitle(treeId, treeNode) {
  37. return treeNode.isParent ? "rename the parent node":"rename the leaf node";
  38. }
  39. var setting = {
  40. edit: {
  41. enable: true,
  42. showRenameBtn: true,
  43. renameTitle: setRenameTitle
  44. }
  45. };
  46. ......</code></pre>
  47. </div>
  48. </div>