[pmg-devel] [PATCH pmg-gui v2] fix #4510: add filter box to many grids

Thomas Lamprecht t.lamprecht at proxmox.com
Wed Feb 21 17:57:31 CET 2024


Am 21/02/2024 um 17:55 schrieb Thomas Lamprecht:
> yeah I could reproduce this here too, this is because the filter needs clearing
> for any change, as otherwise all those filtered out since the last full clear
> won't be considered any more. The following diff on-top fixes this:
> 
> 
> diff --git a/js/form/FilterField.js b/js/form/FilterField.js
> index 53fdfbf..2c6d4b8 100644
> --- a/js/form/FilterField.js
> +++ b/js/form/FilterField.js
> @@ -34,6 +34,9 @@ Ext.define('PMG.form.FilterField', {
>                 me.store = grid.getStore();
>             }
>  
> +           me.store.clearFilter();
> +           field.triggers.clear.setVisible(value.length > 0);
> +
>             if (value) {
>                 me.store.filterBy((rec) => me.filteredFields.some((fieldDef) => {
>                     let fieldname, renderer;
> @@ -47,10 +50,6 @@ Ext.define('PMG.form.FilterField', {
>                     let testedValue = renderer(rec.data[fieldname]);
>                     return testedValue.toString().toLowerCase().indexOf(value.toLowerCase()) !== -1;
>                 }));
> -               field.triggers.clear.setVisible(true);
> -           } else {
> -               me.store.clearFilter();
> -               field.triggers.clear.setVisible(false);
>             }
>         },
>      },
> 
> 

I missed the v3...




More information about the pmg-devel mailing list