]> git.proxmox.com Git - proxmox-widget-toolkit.git/commitdiff
window/edit: add option to disable reset button
authorAaron Lauterer <a.lauterer@proxmox.com>
Mon, 15 Feb 2021 15:26:45 +0000 (16:26 +0100)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Tue, 13 Apr 2021 07:08:29 +0000 (09:08 +0200)
Sometimes the reset button does not make sense and the isCreate option
does not fit as well because with it, the submit button will be enabled
right away instead of waiting for the form to be valid.

Signed-off-by: Aaron Lauterer <a.lauterer@proxmox.com>
src/window/Edit.js

index 17da01a3466032d9ef6429b7a8836313a6c61921..53d0e73abf8d7479bdbb090fffa94538a03c8764 100644 (file)
@@ -25,6 +25,9 @@ Ext.define('Proxmox.window.Edit', {
     // set to true if you want an Remove button (instead of Create)
     isRemove: false,
 
+    // set to false, if you don't want the reset button present
+    showReset: true,
+
     // custom submitText
     submitText: undefined,
 
@@ -349,7 +352,7 @@ Ext.define('Proxmox.window.Edit', {
            me.title = Proxmox.Utils.dialog_title(me.subject, me.isCreate, me.isAdd);
        }
 
-       if (me.isCreate) {
+       if (me.isCreate || !me.showReset) {
                me.buttons = [submitBtn];
        } else {
                me.buttons = [submitBtn, resetBtn];