]> git.proxmox.com Git - pve-manager.git/commitdiff
load the diffstore on init
authorDominik Csapak <d.csapak@proxmox.com>
Wed, 21 Dec 2016 10:45:08 +0000 (11:45 +0100)
committerDietmar Maurer <dietmar@proxmox.com>
Thu, 22 Dec 2016 08:44:24 +0000 (09:44 +0100)
if the rstore in the diffstore is already loaded at the time of
the instantiation, load the data instantly

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
www/manager6/data/DiffStore.js

index eeee5c1d780a1a79ace3accda6ba90f37aa7205d..c93617a765031a5abe4adcf2f3f309da37e03317 100644 (file)
@@ -66,7 +66,7 @@ Ext.define('PVE.data.DiffStore', {
            }
        };
 
-       me.mon(rstore, 'load', function(s, records, success) {
+       var loadFn = function(s, records, success) {
 
            if (!success) {
                return;
@@ -101,6 +101,14 @@ Ext.define('PVE.data.DiffStore', {
            me.resumeEvents();
            me.fireEvent('refresh', me);
            me.fireEvent('datachanged', me);
-       });
+       };
+
+       if (rstore.isLoaded()) {
+           // if store is already loaded,
+           // insert items instantly
+           loadFn(rstore, [], true);
+       }
+
+       me.mon(rstore, 'load', loadFn);
     }
 });