[Lada-commits] [PATCH 1 of 2] Moved stammdaten stores to app.js and load them via storemanager

Wald Commits scm-commit at wald.intevation.org
Thu Nov 6 10:37:53 CET 2014


# HG changeset patch
# User Raimund Renkert <raimund.renkert at intevation.de>
# Date 1415266535 -3600
# Node ID d07e5086a64b969609d3ee5b3cb262caa46ea54b
# Parent  649bf1d08531dbd711a7c692fce29b2de2615bcc
Moved stammdaten stores to app.js and load them via storemanager.

diff -r 649bf1d08531 -r d07e5086a64b app.js
--- a/app.js	Mon Nov 03 12:12:24 2014 +0100
+++ b/app.js	Thu Nov 06 10:35:35 2014 +0100
@@ -3,7 +3,7 @@
  *
  * This file is Free Software under the GNU GPL (v>=3)
  * and comes with ABSOLUTELY NO WARRANTY! Check out
- * the documentation coming with IMIS-Labordaten-Application for details. 
+ * the documentation coming with IMIS-Labordaten-Application for details.
  */
 
 Ext.Loader.setConfig({
@@ -27,7 +27,20 @@
     requires: [
         'Ext.i18n.Bundle',
         'Lada.lib.Helpers',
-        'Ext.layout.container.Column'
+        'Ext.layout.container.Column',
+        'Lada.store.StaDatenbasen',
+        'Lada.store.StaMesseinheiten',
+        'Lada.store.StaMessgroessen',
+        'Lada.store.StaMessmethoden',
+        'Lada.store.StaMessstellen',
+        'Lada.store.StaNetzbetreiber',
+        'Lada.store.StaOrte',
+        'Lada.store.StaPflichtmessgroessen',
+        'Lada.store.StaProbenarten',
+        'Lada.store.StaProbenzusaetze',
+        'Lada.store.StaStaaten',
+        'Lada.store.StaUmwelt',
+        'Lada.store.StaVerwaltungseinheiten'
     ],
     bundle: {
         bundle: 'Lada',
@@ -43,6 +56,45 @@
     // Start the application.
     launch: function() {
         console.log('Launching the application');
+        Ext.create('Lada.store.StaDatenbasen', {
+            storeId: 'staDatenbasen'
+        });
+        Ext.create('Lada.store.StaMesseinheiten', {
+            storeId: 'staMesseinheiten'
+        });
+        Ext.create('Lada.store.StaMessgroessen', {
+            storeId: 'staMessgroessen'
+        });
+        Ext.create('Lada.store.StaMessmethoden', {
+            storeId: 'staMessmethoden'
+        });
+        Ext.create('Lada.store.StaMessstellen', {
+            storeId: 'staMessstellen'
+        });
+        Ext.create('Lada.store.StaNetzbetreiber', {
+            storeId: 'staNetzbetreiber'
+        });
+        Ext.create('Lada.store.StaOrte', {
+            storeId: 'staOrte'
+        });
+        Ext.create('Lada.store.StaPflichtmessgroessen', {
+            storeId: 'staPflichtmessgroessen'
+        });
+        Ext.create('Lada.store.StaProbenarten', {
+            storeId: 'staProbenarten'
+        });
+        Ext.create('Lada.store.StaProbenzusaetze', {
+            storeId: 'staProbenzusaetze'
+        });
+        Ext.create('Lada.store.StaStaaten', {
+            storeId: 'staStaaten'
+        });
+        Ext.create('Lada.store.StaUmwelt', {
+            storeId: 'staUmwelt'
+        });
+        Ext.create('Lada.store.StaVerwaltungseinheiten', {
+            storeId: 'staVerwaltungseinheiten'
+        });
     },
 
     // Define the controllers of the application. They will be initialized
diff -r 649bf1d08531 -r d07e5086a64b app/controller/Messungen.js
--- a/app/controller/Messungen.js	Mon Nov 03 12:12:24 2014 +0100
+++ b/app/controller/Messungen.js	Thu Nov 06 10:35:35 2014 +0100
@@ -22,8 +22,7 @@
         'Messungen',
         'Messwerte',
         'KommentareM',
-        'Status',
-        'StaMessgroessen'
+        'Status'
     ],
 
     init: function() {
diff -r 649bf1d08531 -r d07e5086a64b app/controller/Messwert.js
--- a/app/controller/Messwert.js	Mon Nov 03 12:12:24 2014 +0100
+++ b/app/controller/Messwert.js	Thu Nov 06 10:35:35 2014 +0100
@@ -19,9 +19,7 @@
     stores: [
         'Proben',
         'Messungen',
-        'Messwerte',
-        'StaMesseinheiten',
-        'StaMessgroessen'
+        'Messwerte'
     ],
 
     init: function() {
diff -r 649bf1d08531 -r d07e5086a64b app/controller/Orte.js
--- a/app/controller/Orte.js	Mon Nov 03 12:12:24 2014 +0100
+++ b/app/controller/Orte.js	Thu Nov 06 10:35:35 2014 +0100
@@ -19,10 +19,7 @@
     ],
 
     stores: [
-        'Orte',
-        'StaOrte',
-        'StaStaaten',
-        'StaVerwaltungseinheiten'
+        'Orte'
     ],
 
     models: [
diff -r 649bf1d08531 -r d07e5086a64b app/controller/Proben.js
--- a/app/controller/Proben.js	Mon Nov 03 12:12:24 2014 +0100
+++ b/app/controller/Proben.js	Thu Nov 06 10:35:35 2014 +0100
@@ -89,7 +89,6 @@
     stores: [
         'Proben',
         'Zusatzwerte',
-        'Probenzusatzwerte',
         'KommentareP',
         'Orte',
         'Messungen'
@@ -216,7 +215,7 @@
         var id = record.get('id');
         console.log('id is: ' + id);
         // Load Zusatzwerte
-        var pstore = this.getProbenzusatzwerteStore();
+        var pstore = Ext.data.StoreManager.get('staProbenzusaetze');
         pstore.load();
         var zstore = this.getZusatzwerteStore();
         zstore.load({
diff -r 649bf1d08531 -r d07e5086a64b app/controller/Zusatzwerte.js
--- a/app/controller/Zusatzwerte.js	Mon Nov 03 12:12:24 2014 +0100
+++ b/app/controller/Zusatzwerte.js	Thu Nov 06 10:35:35 2014 +0100
@@ -13,9 +13,7 @@
     ],
 
     stores: [
-        'Zusatzwerte',
-        'StaProbenzusaetze',
-        'StaMesseinheiten'
+        'Zusatzwerte'
     ],
 
     init: function() {
diff -r 649bf1d08531 -r d07e5086a64b app/model/Zusatzwert.js
--- a/app/model/Zusatzwert.js	Mon Nov 03 12:12:24 2014 +0100
+++ b/app/model/Zusatzwert.js	Thu Nov 06 10:35:35 2014 +0100
@@ -52,8 +52,8 @@
     },
 
     getMesseinheit: function(pzsId) {
-        var zstore = Ext.getStore('StaProbenzusaetze');
-        var mstore = Ext.getStore('StaMesseinheiten');
+        var zstore = Ext.data.StoreManager.get('staProbenzusaetze');
+        var mstore = Ext.data.StoreManager.get('staMesseinheiten');
         var mehId = zstore.getById(pzsId).get('mehId');
         console.log('mehid: ' + mehId);
         var record = mstore.getById(mehId);
diff -r 649bf1d08531 -r d07e5086a64b app/view/messwerte/List.js
--- a/app/view/messwerte/List.js	Mon Nov 03 12:12:24 2014 +0100
+++ b/app/view/messwerte/List.js	Thu Nov 06 10:35:35 2014 +0100
@@ -56,7 +56,7 @@
             header: 'Messgröße',
             dataIndex: 'messgroesseId',
             renderer: function(value) {
-                var store = Ext.getStore('StaMessgroessen');
+                var store = Ext.data.StoreManager.get('staMessgroessen');
                 return store.findRecord('id', value).get('messgroesse');
             }
         }, {
@@ -64,11 +64,7 @@
             dataIndex: 'mehId',
             renderer: function(value) {
                 console.log('einheit: ' + value);
-                var store = Ext.data.StoreManager.get('StaMesseinheiten');
-/*                    if (!store) {
-                    store = Ext.create('Lada.store.StaMesseinheiten');
-                }
-*/                    console.log(store.getById(value));
+                var store = Ext.data.StoreManager.get('staMesseinheiten');
                 return store.findRecord('id', value).get('einheit');
             }
         }, {
diff -r 649bf1d08531 -r d07e5086a64b app/view/orte/CreateForm.js
--- a/app/view/orte/CreateForm.js	Mon Nov 03 12:12:24 2014 +0100
+++ b/app/view/orte/CreateForm.js	Thu Nov 06 10:35:35 2014 +0100
@@ -30,7 +30,7 @@
                     if (field.up('window')) {
                         field.up('window').down('fieldset').show();
                     }
-                    var orte = Ext.getStore('StaOrte');
+                    var orte = Ext.data.StoreManager.get('staOrte');
                     var ort = orte.getById(newv);
                     var fields = [
                         'beschreibung',
@@ -46,7 +46,8 @@
                     // is needed as without having this record the field
                     // would only display the raw value (id) of the
                     // verwaltungseinheit.
-                    var verw = Ext.getStore('StaVerwaltungseinheiten');
+                    var verw =
+                        Ext.data.StoreManager.get('staVerwaltungseinheiten');
                     if (ort) {
                         verw.load({
                             id: ort.get('gemId')
diff -r 649bf1d08531 -r d07e5086a64b app/view/orte/List.js
--- a/app/view/orte/List.js	Mon Nov 03 12:12:24 2014 +0100
+++ b/app/view/orte/List.js	Thu Nov 06 10:35:35 2014 +0100
@@ -13,7 +13,6 @@
     extend: 'Ext.grid.Panel',
     alias: 'widget.ortelist',
 
-    store: 'Orte',
     viewConfig: {
         maxHeight: 350,
         emptyText: 'Keine Orte gefunden.',
@@ -51,18 +50,17 @@
             header: 'Staat',
             dataIndex: 'ortId',
             renderer: function(value) {
-                var store = Ext.getStore('StaOrte');
-                var staaten = Ext.getStore('StaStaaten');
-                console.log('staatenstore: ' + staaten);
-                console.log('the staat: ' + store.getById(value).get("staatId"));
-                var record = staaten.getById(store.getById(value).get('staatId'));
+                var store = Ext.data.StoreManager.get('staOrte');
+                var staaten = Ext.data.StoreManager.get('staStaaten');
+                var record =
+                    staaten.getById(store.getById(value).get('staatId'));
                 return record.get('staatIso');
             }
         }, {
             header: 'Gemeineschlüssel',
             dataIndex: 'ortId',
             renderer: function(value) {
-                var store = Ext.getStore('StaOrte');
+                var store = Ext.data.StoreManager.get('staOrte');
                 console.log('value ' + value);
                 var record = store.getById(value);
                 return record.get('gemId');
@@ -72,8 +70,9 @@
             dataIndex: 'ortId',
             flex: 1,
             renderer: function(value) {
-                var store = Ext.getStore('StaOrte');
-                var gemeinden = Ext.getStore('StaVerwaltungseinheiten');
+                var store = Ext.data.StoreManager.get('staOrte');
+                var gemeinden =
+                    Ext.data.StoreManager.get('staVerwaltungseinheiten');
                 var record = store.getById(value);
                 var gemid = record.get('gemId');
                 var record2 = gemeinden.getById(gemid);
@@ -83,7 +82,7 @@
             header: 'Messpunkt',
             dataIndex: 'ortId',
             renderer: function(value) {
-                var store = Ext.getStore('StaOrte');
+                var store = Ext.getStore('staOrte');
                 var record = store.getById(value);
                 return record.get('bezeichnung');
             }
diff -r 649bf1d08531 -r d07e5086a64b app/view/widgets/Datenbasis.js
--- a/app/view/widgets/Datenbasis.js	Mon Nov 03 12:12:24 2014 +0100
+++ b/app/view/widgets/Datenbasis.js	Thu Nov 06 10:35:35 2014 +0100
@@ -25,7 +25,7 @@
     minChars: 0,
 
     initComponent: function() {
-        this.store = Ext.data.StoreManager.get('StaDatenbasen');
+        this.store = Ext.data.StoreManager.get('staDatenbasen');
         if (!this.store) {
             this.store = Ext.create('Lada.store.StaDatenbasen');
         }
diff -r 649bf1d08531 -r d07e5086a64b app/view/widgets/Messeinheit.js
--- a/app/view/widgets/Messeinheit.js	Mon Nov 03 12:12:24 2014 +0100
+++ b/app/view/widgets/Messeinheit.js	Thu Nov 06 10:35:35 2014 +0100
@@ -25,7 +25,7 @@
     minChars: 0,
 
     initComponent: function() {
-        this.store = Ext.data.StoreManager.get('StaMesseinheiten');
+        this.store = Ext.data.StoreManager.get('staMesseinheiten');
         if (!this.store) {
             this.store = Ext.create('Lada.store.StaMesseinheiten');
         }
diff -r 649bf1d08531 -r d07e5086a64b app/view/widgets/Messgroesse.js
--- a/app/view/widgets/Messgroesse.js	Mon Nov 03 12:12:24 2014 +0100
+++ b/app/view/widgets/Messgroesse.js	Thu Nov 06 10:35:35 2014 +0100
@@ -25,7 +25,7 @@
     minChars: 0,
 
     initComponent: function() {
-        this.store = Ext.data.StoreManager.get('StaMessgroessen');
+        this.store = Ext.data.StoreManager.get('staMessgroessen');
         if (!this.store) {
             this.store = Ext.create('Lada.store.StaMessgroessen');
         }
diff -r 649bf1d08531 -r d07e5086a64b app/view/widgets/Messmethode.js
--- a/app/view/widgets/Messmethode.js	Mon Nov 03 12:12:24 2014 +0100
+++ b/app/view/widgets/Messmethode.js	Thu Nov 06 10:35:35 2014 +0100
@@ -26,7 +26,7 @@
     tpl: '<tpl for="."><div class="x-combo-list-item x-boundlist-item" >{id} - {messmethode}</div></tpl>',
 
     initComponent: function() {
-        this.store = Ext.data.StoreManager.get('StaMessmethoden');
+        this.store = Ext.data.StoreManager.get('staMessmethoden');
         if (!this.store) {
             this.store = Ext.create('Lada.store.StaMessmethoden');
         }
diff -r 649bf1d08531 -r d07e5086a64b app/view/widgets/Mst.js
--- a/app/view/widgets/Mst.js	Mon Nov 03 12:12:24 2014 +0100
+++ b/app/view/widgets/Mst.js	Thu Nov 06 10:35:35 2014 +0100
@@ -26,7 +26,7 @@
     minChars: 0,
 
     initComponent: function() {
-        this.store = Ext.data.StoreManager.get('StaMessstellen');
+        this.store = Ext.data.StoreManager.get('staMessstellen');
         if (!this.store) {
             this.store = Ext.create('Lada.store.StaMessstellen');
         }
diff -r 649bf1d08531 -r d07e5086a64b app/view/widgets/Netzbetreiber.js
--- a/app/view/widgets/Netzbetreiber.js	Mon Nov 03 12:12:24 2014 +0100
+++ b/app/view/widgets/Netzbetreiber.js	Thu Nov 06 10:35:35 2014 +0100
@@ -25,7 +25,7 @@
     minChars: 0,
 
     initComponent: function() {
-        this.store = Ext.data.StoreManager.get('StaNetzbetreiber');
+        this.store = Ext.data.StoreManager.get('staNetzbetreiber');
         if (!this.store) {
             this.store = Ext.create('Lada.store.StaNetzbetreiber');
         }
diff -r 649bf1d08531 -r d07e5086a64b app/view/widgets/Ortdetail.js
--- a/app/view/widgets/Ortdetail.js	Mon Nov 03 12:12:24 2014 +0100
+++ b/app/view/widgets/Ortdetail.js	Thu Nov 06 10:35:35 2014 +0100
@@ -25,7 +25,7 @@
     minChars: 0,
 
     initComponent: function() {
-        this.store = Ext.data.StoreManager.get('StaOrte');
+        this.store = Ext.data.StoreManager.get('staOrte');
         if (!this.store) {
             this.store = Ext.create('Lada.store.StaOrte');
         }
diff -r 649bf1d08531 -r d07e5086a64b app/view/widgets/Probenart.js
--- a/app/view/widgets/Probenart.js	Mon Nov 03 12:12:24 2014 +0100
+++ b/app/view/widgets/Probenart.js	Thu Nov 06 10:35:35 2014 +0100
@@ -25,7 +25,7 @@
     minChars: 0,
 
     initComponent: function() {
-        this.store = Ext.data.StoreManager.get('StaProbenarten');
+        this.store = Ext.data.StoreManager.get('staProbenarten');
         if (!this.store) {
             this.store = Ext.create('Lada.store.StaProbenarten');
         }
diff -r 649bf1d08531 -r d07e5086a64b app/view/widgets/Probenzusatzwert.js
--- a/app/view/widgets/Probenzusatzwert.js	Mon Nov 03 12:12:24 2014 +0100
+++ b/app/view/widgets/Probenzusatzwert.js	Thu Nov 06 10:35:35 2014 +0100
@@ -25,7 +25,7 @@
     minChars: 0,
 
     initComponent: function() {
-        this.store = Ext.data.StoreManager.get('StaProbenzusaetze');
+        this.store = Ext.data.StoreManager.get('staProbenzusaetze');
         if (!this.store) {
             this.store = Ext.create('Lada.store.StaProbenzusaetze');
         }
diff -r 649bf1d08531 -r d07e5086a64b app/view/widgets/Staat.js
--- a/app/view/widgets/Staat.js	Mon Nov 03 12:12:24 2014 +0100
+++ b/app/view/widgets/Staat.js	Thu Nov 06 10:35:35 2014 +0100
@@ -25,7 +25,7 @@
     minChars: 0,
 
     initComponent: function() {
-        this.store = Ext.data.StoreManager.get('StaStaaten');
+        this.store = Ext.data.StoreManager.get('staStaaten');
         if (!this.store) {
             this.store = Ext.create('Lada.store.StaStaaten');
         }
diff -r 649bf1d08531 -r d07e5086a64b app/view/widgets/Uwb.js
--- a/app/view/widgets/Uwb.js	Mon Nov 03 12:12:24 2014 +0100
+++ b/app/view/widgets/Uwb.js	Thu Nov 06 10:35:35 2014 +0100
@@ -39,7 +39,7 @@
     //},
 
     initComponent: function() {
-        this.store = Ext.data.StoreManager.get('StaUmwelt');
+        this.store = Ext.data.StoreManager.get('staUmwelt');
         if (!this.store) {
             this.store = Ext.create('Lada.store.StaUmwelt');
         }
diff -r 649bf1d08531 -r d07e5086a64b app/view/zusatzwerte/List.js
--- a/app/view/zusatzwerte/List.js	Mon Nov 03 12:12:24 2014 +0100
+++ b/app/view/zusatzwerte/List.js	Thu Nov 06 10:35:35 2014 +0100
@@ -47,7 +47,7 @@
             header: 'PZW-Größe',
             dataIndex: 'pzsId',
             renderer: function(value) {
-                var store = Ext.getStore('StaProbenzusaetze');
+                var store = Ext.data.StoreManager.get('staProbenzusaetze');
                 var record = store.getById(value);
                 return record.get('beschreibung');
             },
@@ -73,8 +73,8 @@
             header: 'Maßeinheit',
             dataIndex: 'pzsId',
             renderer: function(value) {
-                var zstore = Ext.getStore('StaProbenzusaetze');
-                var mstore = Ext.getStore('StaMesseinheiten');
+                var zstore = Ext.data.StoreManager.get('staProbenzusaetze');
+                var mstore = Ext.data.StoreManager.get('staMesseinheiten');
                 console.log('store: ' + mstore);
                 var mehId = zstore.getById(value).get('mehId');
                 var record = mstore.findRecord('id', mehId);


More information about the Lada-commits mailing list