changeset 496:d07e5086a64b

Moved stammdaten stores to app.js and load them via storemanager.
author Raimund Renkert <raimund.renkert@intevation.de>
date Thu, 06 Nov 2014 10:35:35 +0100
parents 649bf1d08531
children 7c0653e8d9f7
files app.js app/controller/Messungen.js app/controller/Messwert.js app/controller/Orte.js app/controller/Proben.js app/controller/Zusatzwerte.js app/model/Zusatzwert.js app/view/messwerte/List.js app/view/orte/CreateForm.js app/view/orte/List.js app/view/widgets/Datenbasis.js app/view/widgets/Messeinheit.js app/view/widgets/Messgroesse.js app/view/widgets/Messmethode.js app/view/widgets/Mst.js app/view/widgets/Netzbetreiber.js app/view/widgets/Ortdetail.js app/view/widgets/Probenart.js app/view/widgets/Probenzusatzwert.js app/view/widgets/Staat.js app/view/widgets/Uwb.js app/view/zusatzwerte/List.js
diffstat 22 files changed, 89 insertions(+), 50 deletions(-) [+]
line wrap: on
line diff
--- 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
--- 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() {
--- 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() {
--- 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: [
--- 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({
--- 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() {
--- 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);
--- 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');
             }
         }, {
--- 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')
--- 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');
             }
--- 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');
         }
--- 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');
         }
--- 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');
         }
--- 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');
         }
--- 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');
         }
--- 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');
         }
--- 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');
         }
--- 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');
         }
--- 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');
         }
--- 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');
         }
--- 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');
         }
--- 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);

http://lada.wald.intevation.org