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 06A5391D32 for ; Fri, 16 Feb 2024 10:16:25 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id C31B21E356 for ; Fri, 16 Feb 2024 10:16:23 +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 ; Fri, 16 Feb 2024 10:16:23 +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 1142348551 for ; Fri, 16 Feb 2024 10:16:23 +0100 (CET) From: Lukas Wagner To: pve-devel@lists.proxmox.com Date: Fri, 16 Feb 2024 10:16:01 +0100 Message-Id: <20240216091608.60317-13-l.wagner@proxmox.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240216091608.60317-1-l.wagner@proxmox.com> References: <20240216091608.60317-1-l.wagner@proxmox.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SPAM-LEVEL: Spam detection results: 0 AWL -0.004 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 widget-toolkit v3 12/19] 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: Fri, 16 Feb 2024 09:16:25 -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