[pve-devel] [PATCH widget-toolkit v2 1/4] ObjectGrid: optionally show loading mask on load

Dominik Csapak d.csapak at proxmox.com
Mon Oct 17 16:29:55 CEST 2022


as talked off-list, we can omit the whole patch
by using the rstore.load()'s callback directly

(we already have to go into the internals of the objectgrid there,
so we can use 'rstore.load()' directly too instead of 'reload')

On 7/6/22 15:01, Aaron Lauterer wrote:
> Signed-off-by: Aaron Lauterer <a.lauterer at proxmox.com>
> ---
> 
> changes since v1:
> - added description in the documention at the top
> - renamed paramter to "maskOnLoad" as I couldn't come up with something
> more fitting ;)
> 
>   src/grid/ObjectGrid.js | 9 ++++++++-
>   1 file changed, 8 insertions(+), 1 deletion(-)
> 
> diff --git a/src/grid/ObjectGrid.js b/src/grid/ObjectGrid.js
> index b355d6d..065a009 100644
> --- a/src/grid/ObjectGrid.js
> +++ b/src/grid/ObjectGrid.js
> @@ -39,6 +39,8 @@ disabled:: setting this parameter to true will disable selection and focus on
>     the proxmoxObjectGrid as well as greying out input elements. Useful for a
>     readonly tabular display
>   
> +maskOnLoad: if set to true, will show a "Loading..." while the store is loading data
> +
>   */
>   Ext.define('Proxmox.grid.ObjectGrid', {
>       extend: 'Ext.grid.GridPanel',
> @@ -48,6 +50,8 @@ Ext.define('Proxmox.grid.ObjectGrid', {
>       // see top-level doc-comment above for details/example
>       gridRows: [],
>   
> +    maskOnLoad: false,
> +
>       disabled: false,
>       hideHeaders: true,
>   
> @@ -221,7 +225,10 @@ Ext.define('Proxmox.grid.ObjectGrid', {
>   
>       reload: function() {
>   	let me = this;
> -	me.rstore.load();
> +	if (me.maskOnLoad) {
> +	    me.setLoading();
> +	}
> +	me.rstore.load({ callback: () => me.setLoading(false) });
>       },
>   
>       getObjectValue: function(key, defaultValue) {






More information about the pve-devel mailing list