]> git.proxmox.com Git - proxmox-widget-toolkit.git/blobdiff - data/DiffStore.js
data/DiffStore: auto-create the rstore if its just a config
[proxmox-widget-toolkit.git] / data / DiffStore.js
index 6f335f0d87cbc1f856b3e77ad156145f86cc38ef..2fc08bea45e4385537464abc9aa6dbb6b9964616 100644 (file)
@@ -51,7 +51,14 @@ Ext.define('Proxmox.data.DiffStore', {
            throw "no rstore model specified";
        }
 
-       var rstore = config.rstore;
+       let rstore;
+       if (config.rstore.isInstance) {
+           rstore = config.rstore;
+       } else if (config.rstore.type) {
+           rstore = Ext.create(`store.${config.rstore.type}`, config.rstore);
+       } else {
+           throw 'rstore is not an instance, and cannot autocreate without "type"';
+       }
 
        Ext.apply(config, {
            model: rstore.model,