all lists on lists.proxmox.com
 help / color / mirror / Atom feed
* [PATCH manager] ui: cpu flags: add clear trigger to search field
@ 2026-05-20  7:35 Dominik Csapak
  2026-05-20 11:51 ` applied: " Thomas Lamprecht
  0 siblings, 1 reply; 3+ messages in thread
From: Dominik Csapak @ 2026-05-20  7:35 UTC (permalink / raw)
  To: pve-devel

to make it easier to clear it again.

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
---
 www/manager6/form/VMCPUFlagSelector.js | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/www/manager6/form/VMCPUFlagSelector.js b/www/manager6/form/VMCPUFlagSelector.js
index 6996d1a5..73ee5e30 100644
--- a/www/manager6/form/VMCPUFlagSelector.js
+++ b/www/manager6/form/VMCPUFlagSelector.js
@@ -314,12 +314,24 @@ Ext.define('PVE.form.VMCPUFlagSelector', {
                         emptyText: gettext('Search name or description'),
                         submitValue: false,
                         width: 240,
+                        triggers: {
+                            clear: {
+                                cls: 'pmx-clear-trigger',
+                                weight: -1,
+                                hidden: true,
+                                handler: function () {
+                                    this.setValue('');
+                                    this.triggers.clear.setVisible(false);
+                                },
+                            },
+                        },
                         listeners: {
                             change: {
                                 buffer: 100,
                                 fn: function (field, value) {
                                     let store = field.up('grid').getStore();
                                     if (value) {
+                                        field.triggers.clear.setVisible(true);
                                         let lv = value.toLowerCase();
                                         store.addFilter({
                                             id: 'search-filter',
@@ -333,6 +345,7 @@ Ext.define('PVE.form.VMCPUFlagSelector', {
                                             },
                                         });
                                     } else {
+                                        field.triggers.clear.setVisible(false);
                                         store.removeFilter('search-filter');
                                     }
                                 },
-- 
2.47.3





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

* applied: [PATCH manager] ui: cpu flags: add clear trigger to search field
  2026-05-20  7:35 [PATCH manager] ui: cpu flags: add clear trigger to search field Dominik Csapak
@ 2026-05-20 11:51 ` Thomas Lamprecht
  2026-05-20 12:08   ` Dominik Csapak
  0 siblings, 1 reply; 3+ messages in thread
From: Thomas Lamprecht @ 2026-05-20 11:51 UTC (permalink / raw)
  To: pve-devel, Dominik Csapak

On Wed, 20 May 2026 09:35:49 +0200, Dominik Csapak wrote:
> to make it easier to clear it again.

Applied, thanks!

btw. I recently factored out the a few times used pattern of such search fields
into a pveRecordSearchField widget (see form/RecordSearchField.js) and now
adopted the clear trigger there and used in in a few other fitting places now.
FWIW, I hesitated to add this to widget-toolkit, as doing that to early adds a
bit extra friction on future fixes and it's still a code reuse win as is.

[1/1] ui: cpu flags: add clear trigger to search field
      commit: 8ad1e5a8919988a42d4791d2bc8eca6c625285c6




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

* Re: applied: [PATCH manager] ui: cpu flags: add clear trigger to search field
  2026-05-20 11:51 ` applied: " Thomas Lamprecht
@ 2026-05-20 12:08   ` Dominik Csapak
  0 siblings, 0 replies; 3+ messages in thread
From: Dominik Csapak @ 2026-05-20 12:08 UTC (permalink / raw)
  To: Thomas Lamprecht, pve-devel



On 5/20/26 1:55 PM, Thomas Lamprecht wrote:
> On Wed, 20 May 2026 09:35:49 +0200, Dominik Csapak wrote:
>> to make it easier to clear it again.
> 
> Applied, thanks!
> 
> btw. I recently factored out the a few times used pattern of such search fields
> into a pveRecordSearchField widget (see form/RecordSearchField.js) and now
> adopted the clear trigger there and used in in a few other fitting places now.
> FWIW, I hesitated to add this to widget-toolkit, as doing that to early adds a
> bit extra friction on future fixes and it's still a code reuse win as is.

thanks!

had a short look and the refactor of that looks very nice!
I can already think of  a few places where we could reuse that in
PVE/PBS.

> 
> [1/1] ui: cpu flags: add clear trigger to search field
>        commit: 8ad1e5a8919988a42d4791d2bc8eca6c625285c6





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

end of thread, other threads:[~2026-05-20 12:08 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-20  7:35 [PATCH manager] ui: cpu flags: add clear trigger to search field Dominik Csapak
2026-05-20 11:51 ` applied: " Thomas Lamprecht
2026-05-20 12:08   ` Dominik Csapak

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