[pve-devel] [PATCH manager] fix #1115 reload storage grid after template download

Emmanuel Kasper e.kasper at proxmox.com
Mon Sep 26 16:11:13 CEST 2016


On 09/26/2016 03:35 PM, Dietmar Maurer wrote:
>>  			win.show();
>> +			win.on('destroy', me.reload);
>>  			me.close();
> 
> Sorry, but why does it make sense to reload a 'closed' window?
> 

the reload function here will reload the store parent grid

when the win window is defined, the parent component pass its own reload
function with context to the download window

// somewhere in the PVE.storage.ContentView  		
// initComponent
		
		var reload = function() {
	   		 store.load();
			 me.statusStore.load();
			};

		var win = Ext.create('PVE.storage.TemplateDownload', {
		    nodename: nodename,
		    storage: storage,
		    reload: reload
		});


I agree if we had me.reloadParent instead of me.reload the code would be
more readable, so if I will prepare a V2 with better naming




More information about the pve-devel mailing list