Set to show or hide the rename button. It is valid when [setting.edit.enable = true]
When you click the rename button:
1. Click the rename button, you can rename the node.
2. After rename operation (the input DOM blur or press the Enter Key), zTree will trigger the setting.callback.beforeRename callback, and you can decide whether to allow rename.
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.
4. If you don't set the 'beforeRename' or the 'beforeRename' callback return true, so zTree will trigger the setting.callback.onRename callback after rename the node.
Default: true
true means: show the rename button
false means: hide the rename button
zTree unique identifier: treeId.
JSON data object of the node which show the rename button
Return value is same as 'Boolean Format'
var setting = {
edit: {
enable: true,
showRenameBtn: false
}
};
......
function setRenameBtn(treeId, treeNode) {
return !treeNode.isParent;
}
var setting = {
edit: {
enable: true,
showRenameBtn: setRenameBtn
}
};
......