public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
* [pve-devel] [PATCH widget-toolkit 1/2] Combogrid: clear filter on blur
@ 2022-03-09 14:18 Matthias Heiserer
  2022-03-09 14:18 ` [pve-devel] [PATCH widget-toolkit 2/2] ComboGrid: fix sorting when filtering Matthias Heiserer
  2022-03-15 10:03 ` [pve-devel] applied: [PATCH widget-toolkit 1/2] Combogrid: clear filter on blur Dominik Csapak
  0 siblings, 2 replies; 5+ messages in thread
From: Matthias Heiserer @ 2022-03-09 14:18 UTC (permalink / raw)
  To: pve-devel

Previously, deselecting and reselecting the input field
led to the previous filter still being applied, although the
input field was cleared.

Signed-off-by: Matthias Heiserer <m.heiserer@proxmox.com>
---
 src/form/ComboGrid.js | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/form/ComboGrid.js b/src/form/ComboGrid.js
index 923a55a..33c1d75 100644
--- a/src/form/ComboGrid.js
+++ b/src/form/ComboGrid.js
@@ -325,6 +325,7 @@ Ext.define('Proxmox.form.ComboGrid', {
             me.changingFilters = true;
             me.store.removeFilter(filter, true);
             me.changingFilters = false;
+	    me.store.fireEvent('refresh');
         }
     },
 
-- 
2.30.2





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

* [pve-devel] [PATCH widget-toolkit 2/2] ComboGrid: fix sorting when filtering
  2022-03-09 14:18 [pve-devel] [PATCH widget-toolkit 1/2] Combogrid: clear filter on blur Matthias Heiserer
@ 2022-03-09 14:18 ` Matthias Heiserer
  2022-03-15 10:06   ` Dominik Csapak
  2022-03-15 10:03 ` [pve-devel] applied: [PATCH widget-toolkit 1/2] Combogrid: clear filter on blur Dominik Csapak
  1 sibling, 1 reply; 5+ messages in thread
From: Matthias Heiserer @ 2022-03-09 14:18 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>
---
 src/form/ComboGrid.js | 7 +++++++
 1 file changed, 7 insertions(+)

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





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

* [pve-devel] applied: [PATCH widget-toolkit 1/2] Combogrid: clear filter on blur
  2022-03-09 14:18 [pve-devel] [PATCH widget-toolkit 1/2] Combogrid: clear filter on blur Matthias Heiserer
  2022-03-09 14:18 ` [pve-devel] [PATCH widget-toolkit 2/2] ComboGrid: fix sorting when filtering Matthias Heiserer
@ 2022-03-15 10:03 ` Dominik Csapak
  1 sibling, 0 replies; 5+ messages in thread
From: Dominik Csapak @ 2022-03-15 10:03 UTC (permalink / raw)
  To: Proxmox VE development discussion, Matthias Heiserer

applied this one




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

* Re: [pve-devel] [PATCH widget-toolkit 2/2] ComboGrid: fix sorting when filtering
  2022-03-09 14:18 ` [pve-devel] [PATCH widget-toolkit 2/2] ComboGrid: fix sorting when filtering Matthias Heiserer
@ 2022-03-15 10:06   ` Dominik Csapak
  2022-03-16  8:55     ` Matthias Heiserer
  0 siblings, 1 reply; 5+ messages in thread
From: Dominik Csapak @ 2022-03-15 10:06 UTC (permalink / raw)
  To: Proxmox VE development discussion, Matthias Heiserer

On 3/9/22 15:18, 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>
> ---
>   src/form/ComboGrid.js | 7 +++++++
>   1 file changed, 7 insertions(+)
> 
> diff --git a/src/form/ComboGrid.js b/src/form/ComboGrid.js
> index 33c1d75..55aca3a 100644
> --- a/src/form/ComboGrid.js
> +++ b/src/form/ComboGrid.js
> @@ -12,6 +12,7 @@ Ext.define('Proxmox.form.ComboGrid', {
>   
>       // this value is used as default value after load()
>       preferredValue: undefined,
> +    clearFilterOnBlur: false,
>   
>       // hack: allow to select empty value
>       // seems extjs does not allow that when 'editable == false'
> @@ -470,4 +471,10 @@ Ext.define('Proxmox.form.ComboGrid', {
>   	    }
>   	});
>       },
> +
> +    listeners: {
> +	collapse: function() {
> +	    this.clearLocalFilter();
> +	},
> +    },
>   });

i think this is wrong, because we now have no way
to disable that functionality again?

i'd suggest saving the value of clearFilterOnBlur in the initComponent to another property
(e.g. originalClearOnBlur)and then in the collapsehandler only executing the
clear, when the original value was true (or not set, since true is the default)






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

* Re: [pve-devel] [PATCH widget-toolkit 2/2] ComboGrid: fix sorting when filtering
  2022-03-15 10:06   ` Dominik Csapak
@ 2022-03-16  8:55     ` Matthias Heiserer
  0 siblings, 0 replies; 5+ messages in thread
From: Matthias Heiserer @ 2022-03-16  8:55 UTC (permalink / raw)
  To: Dominik Csapak, Proxmox VE development discussion

On 15.03.2022 11:06, Dominik Csapak wrote:
> On 3/9/22 15:18, 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>
>> ---
>>   src/form/ComboGrid.js | 7 +++++++
>>   1 file changed, 7 insertions(+)
>>
>> diff --git a/src/form/ComboGrid.js b/src/form/ComboGrid.js
>> index 33c1d75..55aca3a 100644
>> --- a/src/form/ComboGrid.js
>> +++ b/src/form/ComboGrid.js
>> @@ -12,6 +12,7 @@ Ext.define('Proxmox.form.ComboGrid', {
>>       // this value is used as default value after load()
>>       preferredValue: undefined,
>> +    clearFilterOnBlur: false,
>>       // hack: allow to select empty value
>>       // seems extjs does not allow that when 'editable == false'
>> @@ -470,4 +471,10 @@ Ext.define('Proxmox.form.ComboGrid', {
>>           }
>>       });
>>       },
>> +
>> +    listeners: {
>> +    collapse: function() {
>> +        this.clearLocalFilter();
>> +    },
>> +    },
>>   });
> 
> i think this is wrong, because we now have no way
> to disable that functionality again?
> 
> i'd suggest saving the value of clearFilterOnBlur in the initComponent 
> to another property
> (e.g. originalClearOnBlur)and then in the collapsehandler only executing 
> the
> clear, when the original value was true (or not set, since true is the 
> default)
> 
> 
> 
Not sure if I agree completely.
Yes, it should definitely check for some value before clearing.
However, in which situation would it be desirable to have that check on 
a different property? If "clearFilterOnBlur" is set, that's imo exactly 
what is expected.





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

end of thread, other threads:[~2022-03-16  8:56 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-09 14:18 [pve-devel] [PATCH widget-toolkit 1/2] Combogrid: clear filter on blur Matthias Heiserer
2022-03-09 14:18 ` [pve-devel] [PATCH widget-toolkit 2/2] ComboGrid: fix sorting when filtering Matthias Heiserer
2022-03-15 10:06   ` Dominik Csapak
2022-03-16  8:55     ` Matthias Heiserer
2022-03-15 10:03 ` [pve-devel] applied: [PATCH widget-toolkit 1/2] Combogrid: clear filter on blur Dominik Csapak

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