public inbox for pbs-devel@lists.proxmox.com
 help / color / mirror / Atom feed
* [pbs-devel] [PATCH proxmox-backup 1/3] docs: lto barcod generator: disable add button when fields are not valid
@ 2024-03-06 15:10 Dominik Csapak
  2024-03-06 15:11 ` [pbs-devel] [PATCH proxmox-backup 2/3] docs: lto barcode generator: add lto-9 type Dominik Csapak
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Dominik Csapak @ 2024-03-06 15:10 UTC (permalink / raw)
  To: pbs-devel

otherwise we end up with entries in the list that won't be
displayed/printed anyway.

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
---
 docs/lto-barcode/label-setup.js | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/docs/lto-barcode/label-setup.js b/docs/lto-barcode/label-setup.js
index e65cc7a4..b42a3080 100644
--- a/docs/lto-barcode/label-setup.js
+++ b/docs/lto-barcode/label-setup.js
@@ -46,6 +46,23 @@ Ext.define('LabelSetupPanel', {
 	    let params = view.getValues();
 	    list.getStore().add(params);
 	},
+
+	validitychange: function() {
+	    let me = this;
+	    let isValid = true;
+	    me.getView().query('field').forEach((field) => {
+		if (!field.isValid()) {
+		    isValid = false;
+		}
+	    });
+	    me.lookup('addButton').setDisabled(!isValid);
+	},
+
+	control: {
+	    'field': {
+		validitychange: 'validitychange',
+	    },
+	},
     },
 
     items: [
@@ -93,6 +110,7 @@ Ext.define('LabelSetupPanel', {
 		{
 		    xtype: 'button',
 		    text: 'Add',
+		    reference: 'addButton',
 		    handler: 'onAdd',
 		},
 	    ],
-- 
2.39.2





^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2024-03-07  8:46 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-03-06 15:10 [pbs-devel] [PATCH proxmox-backup 1/3] docs: lto barcod generator: disable add button when fields are not valid Dominik Csapak
2024-03-06 15:11 ` [pbs-devel] [PATCH proxmox-backup 2/3] docs: lto barcode generator: add lto-9 type Dominik Csapak
2024-03-06 15:11 ` [pbs-devel] [PATCH proxmox-backup 3/3] docs: lto barcode generator: add worm tape types Dominik Csapak
2024-03-06 15:13 ` [pbs-devel] [PATCH proxmox-backup 1/3] docs: lto barcod generator: disable add button when fields are not valid Dominik Csapak
2024-03-07  8:46 ` [pbs-devel] applied: " Dietmar Maurer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal