[pve-devel] [PATCH manager 2/4] load the diffstore on init
Dominik Csapak
d.csapak at proxmox.com
Wed Dec 21 11:45:08 CET 2016
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 at proxmox.com>
---
www/manager6/data/DiffStore.js | 12 ++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)
diff --git a/www/manager6/data/DiffStore.js b/www/manager6/data/DiffStore.js
index eeee5c1..c93617a 100644
--- a/www/manager6/data/DiffStore.js
+++ b/www/manager6/data/DiffStore.js
@@ -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);
}
});
--
2.1.4
More information about the pve-devel
mailing list