[pmg-devel] [PATCH pmg-gui 1/3] fix #2680: make Quarantine E-Mail list searchable

Thomas Lamprecht t.lamprecht at proxmox.com
Thu Apr 16 10:35:34 CEST 2020


On 4/15/20 9:56 AM, Dominik Csapak wrote:
> using an explicit load on time change and queryMode 'local', we can
> enable typeAhead (and related settings) to let the user type in an email
> which will be autocompleted by the loaded list.
> 
> Signed-off-by: Dominik Csapak <d.csapak at proxmox.com>
> ---
>  js/QuarantineList.js | 26 +++++++++-----------------
>  1 file changed, 9 insertions(+), 17 deletions(-)
> 
> diff --git a/js/QuarantineList.js b/js/QuarantineList.js
> index a35eefa..25749ab 100644
> --- a/js/QuarantineList.js
> +++ b/js/QuarantineList.js
> @@ -142,10 +142,8 @@ Ext.define('PMG.QuarantineList', {
>  		return;
>  	    }
>  
> -	    // the combobox does not know anything about the extraparams
> -	    // so we disable queryCaching until we expand (and query) again
> -	    combobox.queryCaching = false;
>  	    combobox.getStore().getProxy().setExtraParams(params);
> +	    combobox.getStore().load();
>  
>  	    me.load();
>  	},
> @@ -164,11 +162,6 @@ Ext.define('PMG.QuarantineList', {
>  	    me.load();
>  	},
>  
> -	setQueryCaching: function() {
> -	    this.lookupReference('email').queryCaching = true;
> -	},
> -
> -
>  	savePosition: function(grid, selected, eopts) {
>  	    if (!selected.length) {
>  		return;
> @@ -189,11 +182,7 @@ Ext.define('PMG.QuarantineList', {
>  		selectionchange: 'savePosition'
>  	    },
>  	    'combobox[reference=email]': {
> -		change: {
> -		    fn: 'changeEmail',
> -		    buffer: 500
> -		},
> -		expand: 'setQueryCaching'
> +		change: 'changeEmail',
>  	    },
>  	    datefield: {
>  		change: {
> @@ -257,11 +246,14 @@ Ext.define('PMG.QuarantineList', {
>  			}
>  		    ]
>  		},
> -		queryParam: false,
> -		queryCaching: false,
> -		editable: false,
> +		queryMode: 'local',
> +		editable: true,
> +		typeAhead: true,
> +		forceSelection: true,
> +		autoSelect: true,
> +		anyMatch: true,
> +		selectOnFocus: true,
>  		reference: 'email',
> -		name: 'email',
>  		fieldLabel: 'E-Mail'
>  	    }
>  	]
> 

So from the offlist discussion, I wasn't mistaken that I did something to open
the picker on field focus:
https://git.proxmox.com/?p=pve-manager.git;a=commitdiff;h=851c032d69ad5ae23725dd1add9e4084ebc12650
You ported it over to widget toolkit, so thegit blame is biased ;P
https://git.proxmox.com/?p=proxmox-widget-toolkit.git;a=commitdiff;h=39d9914990920758306edd2c9804b034eaa74e41

We could either create a child class of combobox or override it's initComponent?



More information about the pmg-devel mailing list