From: Dominik Csapak <d.csapak@proxmox.com>
To: pbs-devel@lists.proxmox.com
Subject: [pbs-devel] [PATCH proxmox-backup 1/3] docs: lto barcod generator: disable add button when fields are not valid
Date: Wed, 6 Mar 2024 16:10:59 +0100 [thread overview]
Message-ID: <20240306151101.365405-1-d.csapak@proxmox.com> (raw)
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
next reply other threads:[~2024-03-06 15:11 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-03-06 15:10 Dominik Csapak [this message]
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240306151101.365405-1-d.csapak@proxmox.com \
--to=d.csapak@proxmox.com \
--cc=pbs-devel@lists.proxmox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal