CLIENT GUI Framework
[vnfsdk/refrepo.git] / portal-common / src / main / webapp / common / thirdparty / zTree / api / en / setting.edit.showRenameBtn.html
1 <div class="apiDetail">\r
2 <div>\r
3         <h2><span>Boolean / Function(treeId, treeNode)</span><span class="path">setting.edit.</span>showRenameBtn</h2>\r
4         <h3>Overview<span class="h3_info">[ depends on <span class="highlight_green">jquery.ztree.exedit</span> js ]</span></h3>\r
5         <div class="desc">\r
6                 <p></p>\r
7                 <div class="longdesc">\r
8                         <p>Set to show or hide the rename button. It is valid when <span class="highlight_red">[setting.edit.enable = true]</span></p>\r
9                         <p>When you click the rename button:</p>\r
10                         <p>1. Click the rename button, you can rename the node.</p>\r
11                         <p>2. After rename operation (the input DOM blur or press the Enter Key), zTree will trigger the <span class="highlight_red">setting.callback.beforeRename</span> callback, and you can decide whether to allow rename.</p>\r
12                         <p>3. If the 'beforeRename' callback return false, so zTree will keep the edit status. (Press the ESC key, can be restored to the original state.</p>\r
13                         <p>4. If you don't set the 'beforeRename' or  the 'beforeRename' callback return true, so zTree will trigger the <span class="highlight_red">setting.callback.onRename</span> callback after rename the node.</p>\r
14                         <p>Default: true</p>\r
15                 </div>\r
16         </div>\r
17         <h3>Boolean Format</h3>\r
18         <div class="desc">\r
19         <p> true means: show the rename button</p>\r
20         <p> false means: hide the rename button</p>\r
21         </div>\r
22         <h3>Function Parameter Descriptions</h3>\r
23         <div class="desc">\r
24         <h4><b>treeId</b><span>String</span></h4>\r
25         <p>zTree unique identifier: <b class="highlight_red">treeId</b>, easy for users to control.</p>\r
26         <h4 class="topLine"><b>treeNode</b><span>JSON</span></h4>\r
27         <p>JSON data object of the node which show the rename button</p>\r
28         <h4 class="topLine"><b>Return </b><span>Boolean</span></h4>\r
29         <p>Return value is same as 'Boolean Format'</p>\r
30         </div>\r
31         <h3>Examples of setting & function</h3>\r
32         <h4>1. Hide the rename button</h4>\r
33         <pre xmlns=""><code>var setting = {\r
34         edit: {\r
35                 enable: true,\r
36                 showRenameBtn: false\r
37         }\r
38 };\r
39 ......</code></pre>\r
40         <h4>2. Hide the rename button of parent node</h4>\r
41         <pre xmlns=""><code>function setRenameBtn(treeId, treeNode) {\r
42         return !treeNode.isParent;\r
43 }\r
44 var setting = {\r
45         edit: {\r
46                 enable: true,\r
47                 showRenameBtn: setRenameBtn\r
48         }\r
49 };\r
50 ......</code></pre>\r
51 </div>\r
52 </div>