[pve-devel] [PATCH widget-toolkit 2/2] ComboGrid: fix sorting when filtering

Dominik Csapak d.csapak at proxmox.com
Tue Mar 15 11:06:41 CET 2022


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 at 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)







More information about the pve-devel mailing list