public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
* [pve-devel] [PATCH widget-toolkit V2] ComboGrid: fix sorting when filtering
@ 2022-03-16 11:34 Matthias Heiserer
  2022-04-27 10:01 ` Thomas Lamprecht
  0 siblings, 1 reply; 3+ messages in thread
From: Matthias Heiserer @ 2022-03-16 11:34 UTC (permalink / raw)
  To: pve-devel

When clicking on a column to sort it, the filter doesn't reset.
Previously, it forgot the filter until the value was changed.

Signed-off-by: Matthias Heiserer <m.heiserer@proxmox.com>
---
Changes from v1:
Introduce a config property to (en|dis)disable clearing the filter
 src/form/ComboGrid.js | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/src/form/ComboGrid.js b/src/form/ComboGrid.js
index 33c1d75..fa1078d 100644
--- a/src/form/ComboGrid.js
+++ b/src/form/ComboGrid.js
@@ -12,6 +12,9 @@ Ext.define('Proxmox.form.ComboGrid', {
 
     // this value is used as default value after load()
     preferredValue: undefined,
+    clearFilterOnBlur: false,
+    clearFilterOnExit: true,
+
 
     // hack: allow to select empty value
     // seems extjs does not allow that when 'editable == false'
@@ -470,4 +473,12 @@ Ext.define('Proxmox.form.ComboGrid', {
 	    }
 	});
     },
+
+    listeners: {
+	collapse: function() {
+	    if (this.clearFilterOnExit) {
+		this.clearLocalFilter();
+	    }
+	},
+    },
 });
-- 
2.30.2





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

* Re: [pve-devel] [PATCH widget-toolkit V2] ComboGrid: fix sorting when filtering
  2022-03-16 11:34 [pve-devel] [PATCH widget-toolkit V2] ComboGrid: fix sorting when filtering Matthias Heiserer
@ 2022-04-27 10:01 ` Thomas Lamprecht
  2022-04-28  9:57   ` Matthias Heiserer
  0 siblings, 1 reply; 3+ messages in thread
From: Thomas Lamprecht @ 2022-04-27 10:01 UTC (permalink / raw)
  To: Proxmox VE development discussion, Matthias Heiserer

On 16.03.22 12:34, Matthias Heiserer wrote:
> When clicking on a column to sort it, the filter doesn't reset.
> Previously, it forgot the filter until the value was changed.
> 
> Signed-off-by: Matthias Heiserer <m.heiserer@proxmox.com>
> ---
> Changes from v1:
> Introduce a config property to (en|dis)disable clearing the filter

nit, ant I don't want to be annoying, but can you please add a empty line
below, and maybe even above the series-change log for easier visibility?
I'd at least appreciate that quite a bit, thx!

>  src/form/ComboGrid.js | 11 +++++++++++
>  1 file changed, 11 insertions(+)
> 
> diff --git a/src/form/ComboGrid.js b/src/form/ComboGrid.js
> index 33c1d75..fa1078d 100644
> --- a/src/form/ComboGrid.js
> +++ b/src/form/ComboGrid.js
> @@ -12,6 +12,9 @@ Ext.define('Proxmox.form.ComboGrid', {
>  
>      // this value is used as default value after load()
>      preferredValue: undefined,
> +    clearFilterOnBlur: false,

this changes the default of an ExtJS config that is used in other context though?


> +    clearFilterOnExit: true,
> +
>  
>      // hack: allow to select empty value
>      // seems extjs does not allow that when 'editable == false'
> @@ -470,4 +473,12 @@ Ext.define('Proxmox.form.ComboGrid', {
>  	    }
>  	});
>      },
> +
> +    listeners: {
> +	collapse: function() {
> +	    if (this.clearFilterOnExit) {
> +		this.clearLocalFilter();
> +	    }
> +	},
> +    },
>  });





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

* Re: [pve-devel] [PATCH widget-toolkit V2] ComboGrid: fix sorting when filtering
  2022-04-27 10:01 ` Thomas Lamprecht
@ 2022-04-28  9:57   ` Matthias Heiserer
  0 siblings, 0 replies; 3+ messages in thread
From: Matthias Heiserer @ 2022-04-28  9:57 UTC (permalink / raw)
  To: Thomas Lamprecht, Proxmox VE development discussion

On 27.04.2022 12:01, Thomas Lamprecht wrote:
> nit, ant I don't want to be annoying, but can you please add a empty line
> below, and maybe even above the series-change log for easier visibility?
> I'd at least appreciate that quite a bit, thx!
> 
Sure!
>>   src/form/ComboGrid.js | 11 +++++++++++
>>   1 file changed, 11 insertions(+)
>>
>> diff --git a/src/form/ComboGrid.js b/src/form/ComboGrid.js
>> index 33c1d75..fa1078d 100644
>> --- a/src/form/ComboGrid.js
>> +++ b/src/form/ComboGrid.js
>> @@ -12,6 +12,9 @@ Ext.define('Proxmox.form.ComboGrid', {
>>   
>>       // this value is used as default value after load()
>>       preferredValue: undefined,
>> +    clearFilterOnBlur: false,
> 
> this changes the default of an ExtJS config that is used in other context though?
>
I think the idea was that the current behaviour (clearing filter when 
sorting) is undesirable in all grids and as default, but can be 
overridden. Meanwhile, the collapse listener covers the cases where 
clearing the filter is desired and already happens.

Depending on which you prefer, I'll send in a v2 with a/this short 
explanation included, otherwise I guess the best thing would be a custom 
child class for this functionality and use that in all the places where 
it definitely makes sense?





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

end of thread, other threads:[~2022-04-28  9:57 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-16 11:34 [pve-devel] [PATCH widget-toolkit V2] ComboGrid: fix sorting when filtering Matthias Heiserer
2022-04-27 10:01 ` Thomas Lamprecht
2022-04-28  9:57   ` Matthias Heiserer

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