1 <div class="apiDetail">
\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
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
17 <h3>Boolean Format</h3>
\r
19 <p> true means: show the rename button</p>
\r
20 <p> false means: hide the rename button</p>
\r
22 <h3>Function Parameter Descriptions</h3>
\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
31 <h3>Examples of setting & function</h3>
\r
32 <h4>1. Hide the rename button</h4>
\r
33 <pre xmlns=""><code>var setting = {
\r
36 showRenameBtn: false
\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
47 showRenameBtn: setRenameBtn
\r