From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by lists.proxmox.com (Postfix) with ESMTPS id BB290B97FD for ; Mon, 11 Dec 2023 13:51:08 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 774D6162CB for ; Mon, 11 Dec 2023 13:50:13 +0100 (CET) Received: from proxmox-new.maurer-it.com (proxmox-new.maurer-it.com [94.136.29.106]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by firstgate.proxmox.com (Proxmox) with ESMTPS for ; Mon, 11 Dec 2023 13:50:11 +0100 (CET) Received: from proxmox-new.maurer-it.com (localhost.localdomain [127.0.0.1]) by proxmox-new.maurer-it.com (Proxmox) with ESMTP id 48C6A4538A for ; Mon, 11 Dec 2023 13:50:09 +0100 (CET) From: Lukas Wagner To: pve-devel@lists.proxmox.com Date: Mon, 11 Dec 2023 13:49:48 +0100 Message-Id: <20231211124955.211219-15-l.wagner@proxmox.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231211124955.211219-1-l.wagner@proxmox.com> References: <20231211124955.211219-1-l.wagner@proxmox.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SPAM-LEVEL: Spam detection results: 0 AWL -0.006 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record T_SCC_BODY_TEXT_LINE -0.01 - Subject: [pve-devel] [PATCH proxmox-widget-toolkit 14/21] combogrid: add 'showClearTrigger' config X-BeenThere: pve-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox VE development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Dec 2023 12:51:08 -0000 This allows one configure the clear trigger to be shown, even if 'allowBlank' is set false. This can be useful if one has a non-editable combogrid where the value is set to something not present in the store. Example: Match rule editing, one selects a backup job to be match. If the backup job is removed and the match rule edit window is opened again, then the old, deleted value cannot be removed from the combogrid if there is no clear trigger. Signed-off-by: Lukas Wagner --- src/form/ComboGrid.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/form/ComboGrid.js b/src/form/ComboGrid.js index 6338a3a..3aaa717 100644 --- a/src/form/ComboGrid.js +++ b/src/form/ComboGrid.js @@ -32,6 +32,7 @@ Ext.define('Proxmox.form.ComboGrid', { notFoundIsValid: false, deleteEmpty: false, errorHeight: 100, + showClearTrigger: false, }, // needed to trigger onKeyUp etc. @@ -54,7 +55,10 @@ Ext.define('Proxmox.form.ComboGrid', { setValue: function(value) { let me = this; let empty = Ext.isArray(value) ? !value.length : !value; - me.triggers.clear.setVisible(!empty && me.allowBlank); + me.triggers.clear.setVisible( + (!empty && me.allowBlank) || + (!empty && me.showClearTrigger), + ); return me.callParent([value]); }, -- 2.39.2