CLIENT GUI Framework
[vnfsdk/refrepo.git] / openo-portal / portal-common / src / main / webapp / common / thirdparty / zTree / api / en / setting.edit.showRemoveBtn.html
1 <div class="apiDetail">\r
2 <div>\r
3         <h2><span>Boolean / Function(treeId, treeNode)</span><span class="path">setting.edit.</span>showRemoveBtn</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 remove button. It is valid when <span class="highlight_red">[setting.edit.enable = true]</span></p>\r
9                         <p>When you click the remove button:</p>\r
10                         <p>1. zTree will trigger the <span class="highlight_red">setting.callback.beforeRemove</span> callback, and you can decide whether to allow delete.</p>\r
11                         <p>2. If you don't set the 'beforeRemove' or  the 'beforeRemove' callback return true, so zTree will trigger the <span class="highlight_red">setting.callback.onRemove</span> callback after remove the node.</p>\r
12                         <p>Default: true</p>\r
13                 </div>\r
14         </div>\r
15         <h3>Boolean Format</h3>\r
16         <div class="desc">\r
17         <p> true means: show the remove button</p>\r
18         <p> false means: hide the remove button</p>\r
19         </div>\r
20         <h3>Function Parameter Descriptions</h3>\r
21         <div class="desc">\r
22         <h4><b>treeId</b><span>String</span></h4>\r
23         <p>zTree unique identifier: <b class="highlight_red">treeId</b>, easy for users to control.</p>\r
24         <h4 class="topLine"><b>treeNode</b><span>JSON</span></h4>\r
25         <p>JSON data object of the node which show the remove button</p>\r
26         <h4 class="topLine"><b>Return </b><span>Boolean</span></h4>\r
27         <p>Return value is same as 'Boolean Format'</p>\r
28         </div>\r
29         <h3>Examples of setting & function</h3>\r
30         <h4>1. Hide the remove button</h4>\r
31         <pre xmlns=""><code>var setting = {\r
32         edit: {\r
33                 enable: true,\r
34                 showRemoveBtn: false\r
35         }\r
36 };\r
37 ......</code></pre>\r
38         <h4>2. Hide the remove button of parent node</h4>\r
39         <pre xmlns=""><code>function setRemoveBtn(treeId, treeNode) {\r
40         return !treeNode.isParent;\r
41 }\r
42 var setting = {\r
43         edit: {\r
44                 enable: true,\r
45                 showRemoveBtn: setRemoveBtn\r
46         }\r
47 };\r
48 ......</code></pre>\r
49 </div>\r
50 </div>