changeset 490:446e99cfd425

Updated views and controllers using the new model and stores.
author Raimund Renkert <raimund.renkert@intevation.de>
date Fri, 31 Oct 2014 21:28:31 +0100
parents 6056a7fd9aa2
children 850ccfe5f3c4
files app/controller/Base.js app/controller/Kommentare.js app/controller/MKommentare.js app/controller/Messungen.js app/controller/Messwert.js app/controller/Orte.js app/controller/Proben.js app/controller/Status.js app/controller/Zusatzwerte.js app/view/Viewport.js app/view/kommentare/CreateForm.js app/view/kommentare/List.js app/view/messungen/List.js app/view/messwerte/List.js app/view/mkommentare/CreateForm.js app/view/mkommentare/List.js app/view/orte/CreateForm.js app/view/orte/List.js app/view/proben/Edit.js app/view/status/CreateForm.js app/view/status/List.js app/view/widgets/Betriebsart.js app/view/widgets/Datenbasis.js app/view/widgets/Datetime.js app/view/widgets/LadaForm.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/widgets/Verwaltungseinheit.js app/view/zusatzwerte/List.js
diffstat 37 files changed, 330 insertions(+), 346 deletions(-) [+]
line wrap: on
line diff
--- a/app/controller/Base.js	Fri Oct 31 21:11:25 2014 +0100
+++ b/app/controller/Base.js	Fri Oct 31 21:28:31 2014 +0100
@@ -75,7 +75,7 @@
         Ext.MessageBox.confirm('Löschen', 'Sind Sie sicher?', function(btn){
             if(btn === 'yes'){
                 var store = grid.getStore();
-                var deleteUrl = selection.getProxy().url + selection.getEidi();
+                var deleteUrl = selection.getProxy().url + selection.getId();
                 Ext.Ajax.request({
                     url: deleteUrl,
                     method: 'DELETE',
--- a/app/controller/Kommentare.js	Fri Oct 31 21:11:25 2014 +0100
+++ b/app/controller/Kommentare.js	Fri Oct 31 21:28:31 2014 +0100
@@ -15,10 +15,10 @@
         'kommentare.Create'
     ],
     stores: [
-        'Kommentare'
+        'KommentareP'
     ],
     models: [
-        'Kommentar'
+        'KommentarP'
     ],
     init: function() {
         console.log('Initialising the Kommentare controller');
@@ -46,7 +46,7 @@
     },
     addItem: function(button) {
         console.log('Adding new Kommentar for Probe ' + button.probeId);
-        var kommentar = Ext.create('Lada.model.Kommentar');
+        var kommentar = Ext.create('Lada.model.KommentarP');
         kommentar.set('probeId', button.probeId);
         var view = Ext.widget('kommentarecreate', {model: kommentar});
     },
@@ -64,7 +64,7 @@
         }
     },
     createSuccess: function(form, record, operation) {
-        var store = this.getKommentareStore();
+        var store = this.getKommentarePStore();
         store.reload();
         var win = form.up('window');
         win.close();
--- a/app/controller/MKommentare.js	Fri Oct 31 21:11:25 2014 +0100
+++ b/app/controller/MKommentare.js	Fri Oct 31 21:28:31 2014 +0100
@@ -15,10 +15,10 @@
         'mkommentare.Create'
     ],
     stores: [
-        'MKommentare'
+        'KommentareM'
     ],
     models: [
-        'MKommentar'
+        'KommentarM'
     ],
     init: function() {
         console.log('Initialising the MKommentare controller');
@@ -46,14 +46,16 @@
     },
     addItem: function(button) {
         console.log('Adding new MKommentar for Messung ' + button.parentId + ' Probe ' + button.probeId);
-        var kommentar = Ext.create('Lada.model.MKommentar');
+        var kommentar = Ext.create('Lada.model.KommentarM');
         kommentar.set('probeId', button.probeId);
         kommentar.set('messungsId', button.parentId);
         var view = Ext.widget('mkommentarecreate', {model: kommentar});
     },
     editItem: function(grid, record) {
         console.log('Editing Kommentar');
-        record.getAuthInfo(this.initEditWindow)
+        var mstore = Ext.data.StoreManager.get('Messungen');
+        var messung = mstore.getById(record.get('messungsId'));
+        record.getAuthInfo(this.initEditWindow, messung.get('probeId'))
         console.log("Loaded MKommentar with ID " + record.getId()); //outputs ID
     },
     initEditWindow: function(record, readonly, owner) {
@@ -66,7 +68,7 @@
     },
     createSuccess: function(form, record, operation) {
         // Reload store
-        var store = this.getMKommentareStore();
+        var store = this.getKommentareMStore();
         store.reload();
         var win = form.up('window');
         win.close();
--- a/app/controller/Messungen.js	Fri Oct 31 21:11:25 2014 +0100
+++ b/app/controller/Messungen.js	Fri Oct 31 21:28:31 2014 +0100
@@ -19,9 +19,9 @@
         'Proben',
         'Messungen',
         'Messwerte',
-        'MKommentare',
+        'KommentareM',
         'Status',
-        'Messgroessen'
+        'StaMessgroessen'
     ],
     init: function() {
         console.log('Initialising the Messungen controller');
@@ -67,25 +67,25 @@
     },
     editItem: function(grid, record) {
         console.log('Editing Messung');
-        var kstore = this.getMKommentareStore();
+        var kstore = this.getKommentareMStore();
         kstore.load({
             params: {
                 probeId: record.get('probeId'),
-                messungsId: record.get('messungsId')
+                messungsId: record.get('id')
             }
         });
         var sstore = this.getStatusStore();
         sstore.load({
             params: {
                 probeId: record.get('probeId'),
-                messungsId: record.get('messungsId')
+                messungsId: record.get('id')
             }
         });
         var mstore = this.getMesswerteStore();
         mstore.load({
             params: {
                 probeId: record.get('probeId'),
-                messungsId: record.get('messungsId')
+                messungsId: record.get('id')
             }
         });
         record.getAuthInfo(this.initEditWindow);
@@ -109,7 +109,7 @@
         Ext.MessageBox.confirm('Löschen', 'Sind Sie sicher?', function(btn){
             if(btn === 'yes'){
                 var store = grid.getStore();
-                var deleteUrl = selection.getProxy().url + selection.getEidi();
+                var deleteUrl = selection.getProxy().url + selection.getId();
                 Ext.Ajax.request({
                     url: deleteUrl,
                     method: 'DELETE',
--- a/app/controller/Messwert.js	Fri Oct 31 21:11:25 2014 +0100
+++ b/app/controller/Messwert.js	Fri Oct 31 21:28:31 2014 +0100
@@ -18,8 +18,8 @@
         'Proben',
         'Messungen',
         'Messwerte',
-        'Messeinheit',
-        'Messgroessen'
+        'StaMesseinheiten',
+        'StaMessgroessen'
     ],
     init: function() {
         console.log('Initialising the Messwert controller');
@@ -59,7 +59,10 @@
     },
     editItem: function(grid, record) {
         console.log('Editing Messwert');
-        record.getAuthInfo(this.initEditWindow);
+        var mstore = Ext.data.StoreManager.get('Messungen');
+        var pstore = Ext.data.StoreManager.get('Proben');
+        var messung = mstore.getById(record.get('messungsId'))
+        record.getAuthInfo(this.initEditWindow, messung.get('probeId'));
         console.log("Loaded Messwert with ID " + record.getId()); //outputs ID
     },
     initEditWindow: function(record, readonly, owner) {
@@ -76,7 +79,7 @@
         Ext.MessageBox.confirm('Löschen', 'Sind Sie sicher?', function(btn){
             if(btn === 'yes'){
                 var store = grid.getStore();
-                var deleteUrl = selection.getProxy().url + selection.getEidi();
+                var deleteUrl = selection.getProxy().url + selection.getId();
                 Ext.Ajax.request({
                     url: deleteUrl,
                     method: 'DELETE',
--- a/app/controller/Orte.js	Fri Oct 31 21:11:25 2014 +0100
+++ b/app/controller/Orte.js	Fri Oct 31 21:28:31 2014 +0100
@@ -18,9 +18,9 @@
     ],
     stores: [
         'Orte',
-        'Ortedetails',
-        'Staaten',
-        'Verwaltungseinheiten'
+        'StaOrte',
+        'StaStaaten',
+        'StaVerwaltungseinheiten'
     ],
     models: [
         'Ort'
--- a/app/controller/Proben.js	Fri Oct 31 21:11:25 2014 +0100
+++ b/app/controller/Proben.js	Fri Oct 31 21:28:31 2014 +0100
@@ -88,7 +88,7 @@
         'Proben',
         'Zusatzwerte',
         'Probenzusatzwerte',
-        'Kommentare',
+        'KommentareP',
         'Orte',
         'Messungen'
     ],
@@ -200,7 +200,8 @@
     },
     editItem: function(grid, record) {
         console.log('Editing Probe');
-        var id = record.get('probeId');
+        var id = record.get('id');
+        console.log('id is: ' + id);
         // Load Zusatzwerte
         var pstore = this.getProbenzusatzwerteStore();
         pstore.load();
@@ -211,7 +212,7 @@
             }
         });
         // Load Kommentare
-        var kstore = this.getKommentareStore();
+        var kstore = this.getKommentarePStore();
         kstore.load({
             params: {
                 probeId: id
@@ -232,6 +233,7 @@
             }
         });
         var view = Ext.widget('probenedit', {modelId: id});
+        view.show();
         console.log("Loaded Probe with ID " + record.getId()); //outputs ID
     },
     createSuccess: function(form, record, response) {
--- a/app/controller/Status.js	Fri Oct 31 21:11:25 2014 +0100
+++ b/app/controller/Status.js	Fri Oct 31 21:28:31 2014 +0100
@@ -51,7 +51,9 @@
     },
     editItem: function(grid, record) {
         console.log('Editing Status');
-        record.getAuthInfo(this.initEditWindow)
+        var mstore = Ext.data.StoreManager.get('Messungen');
+        var messung = mstore.getById(record.get('messungsId'));
+        record.getAuthInfo(this.initEditWindow, messung.get('probeId'));
         console.log("Loaded Status with ID " + record.getId()); //outputs ID
     },
     initEditWindow: function(record, readonly, owner) {
--- a/app/controller/Zusatzwerte.js	Fri Oct 31 21:11:25 2014 +0100
+++ b/app/controller/Zusatzwerte.js	Fri Oct 31 21:28:31 2014 +0100
@@ -13,8 +13,8 @@
     ],
     stores: [
         'Zusatzwerte',
-        'Probenzusatzwerte',
-        'Messeinheit'
+        'StaProbenzusaetze',
+        'StaMesseinheiten'
     ],
     init: function() {
         console.log('Initialising the Zusatzwerte controller');
--- a/app/view/Viewport.js	Fri Oct 31 21:11:25 2014 +0100
+++ b/app/view/Viewport.js	Fri Oct 31 21:28:31 2014 +0100
@@ -110,7 +110,7 @@
      */
     initMessung: function() {
         var store = Ext.getStore('Messungen');
-        var kstore = Ext.getStore('MKommentare');
+        var kstore = Ext.getStore('KommentareM');
         var mstore = Ext.getStore('Messwerte');
         var sstore = Ext.getStore('Status');
         probeId = "000007578314X";
--- a/app/view/kommentare/CreateForm.js	Fri Oct 31 21:11:25 2014 +0100
+++ b/app/view/kommentare/CreateForm.js	Fri Oct 31 21:28:31 2014 +0100
@@ -21,12 +21,12 @@
             },
             {
                 xtype: 'datetime',
-                name: 'kdatum',
+                name: 'datum',
                 fieldLabel: 'Datum'
             },
             {
                 xtype: 'textareafield',
-                name: 'ktext',
+                name: 'text',
                 fieldLabel: 'Text'
             }
         ];
--- a/app/view/kommentare/List.js	Fri Oct 31 21:11:25 2014 +0100
+++ b/app/view/kommentare/List.js	Fri Oct 31 21:28:31 2014 +0100
@@ -12,7 +12,7 @@
 Ext.define('Lada.view.kommentare.List' ,{
     extend: 'Ext.grid.Panel',
     alias: 'widget.kommentarelist',
-    store: 'Kommentare',
+    store: 'KommentareP',
     viewConfig: {
         maxHeight: 350,
         emptyText: 'Keine Kommentaregefunden.',
--- a/app/view/messungen/List.js	Fri Oct 31 21:11:25 2014 +0100
+++ b/app/view/messungen/List.js	Fri Oct 31 21:28:31 2014 +0100
@@ -43,7 +43,7 @@
             }
         ];
         this.columns = [
-            {header: 'Mess.ID', dataIndex: "messungsId", width: 50},
+            {header: 'Mess.ID', dataIndex: "id", width: 50},
             {header: 'NPR-Nr.', dataIndex: "nebenprobenNr", width: 50},
             {header: 'MMT', dataIndex: "mmtId", width: 50},
             {header: 'Messzeit', dataIndex: "messzeitpunkt"},
@@ -55,7 +55,7 @@
                     sstore.load({
                         params: {
                             probeId: value.probeId,
-                            messungsId: value.messungsId
+                            messungsId: value.id
                         }
                     });
                     if (sstore.getTotalCount() === 0) {
@@ -84,7 +84,7 @@
                     mstore.load({
                         params: {
                             probeId: value.probeId,
-                            messungsId: value.messungsId
+                            messungsId: value.id
                         }
                     });
                     return mstore.getTotalCount();
@@ -95,11 +95,11 @@
                 flex: 1,
                 dataIndex: 'id',
                 renderer: function(value) {
-                    var kstore = Ext.getStore('MKommentare');
+                    var kstore = Ext.getStore('KommentareM');
                     kstore.load({
                         params: {
                             probeId: value.probeId,
-                            messungsId: value.messungsId
+                            messungsId: value.id
                         }
                     });
                     return kstore.getTotalCount();
--- a/app/view/messwerte/List.js	Fri Oct 31 21:11:25 2014 +0100
+++ b/app/view/messwerte/List.js	Fri Oct 31 21:28:31 2014 +0100
@@ -11,6 +11,7 @@
  */
 Ext.define('Lada.view.messwerte.List' ,{
     extend: 'Ext.grid.Panel',
+    require: ['Lada.store.StaMesseinheit'],
     alias: 'widget.messwertelist',
     store: 'Messwerte',
     viewConfig: {
@@ -58,16 +59,21 @@
                 header: 'Messgröße',
                 dataIndex: 'messgroesseId',
                 renderer: function(value) {
-                    var store = Ext.getStore('Messgroessen');
-                    return store.findRecord('messgroesseId', value).get('messgroesse');
+                    var store = Ext.getStore('StaMessgroessen');
+                    return store.findRecord('id', value).get('messgroesse');
                 }
             },
             {
                 header: 'Messeinheit',
                 dataIndex: 'mehId',
                 renderer: function(value) {
-                    var store = Ext.getStore('Messeinheit');
-                    return store.findRecord('mehId', value).get('einheit');
+                    console.log('einheit: ' + value);
+                    var store = Ext.data.StoreManager.get('StaMesseinheiten');
+/*                    if (!store) {
+                        store = Ext.create('Lada.store.StaMesseinheiten');
+                    }
+*/                    console.log(store.getById(value));
+                    return store.findRecord('id', value).get('einheit');
                 }
             },
             {
--- a/app/view/mkommentare/CreateForm.js	Fri Oct 31 21:11:25 2014 +0100
+++ b/app/view/mkommentare/CreateForm.js	Fri Oct 31 21:28:31 2014 +0100
@@ -11,7 +11,7 @@
  */
 Ext.define('Lada.view.mkommentare.CreateForm', {
     extend: 'Lada.view.widgets.LadaForm',
-    model: 'Lada.model.MKommentar',
+    model: 'Lada.model.KommentarM',
     initComponent: function() {
         this.items = [
             {
@@ -21,13 +21,13 @@
             },
             {
                 xtype: 'datetime',
-                name: 'kdatum',
+                name: 'datum',
                 fieldLabel: 'Datum'
             },
             {
                 xtype: 'textareafield',
                 maxLength: 1024,
-                name: 'ktext',
+                name: 'text',
                 fieldLabel: 'Text'
             }
         ];
--- a/app/view/mkommentare/List.js	Fri Oct 31 21:11:25 2014 +0100
+++ b/app/view/mkommentare/List.js	Fri Oct 31 21:28:31 2014 +0100
@@ -12,7 +12,7 @@
 Ext.define('Lada.view.mkommentare.List' ,{
     extend: 'Ext.grid.Panel',
     alias: 'widget.mkommentarelist',
-    store: 'MKommentare',
+    store: 'KommentareM',
     viewConfig: {
         maxHeight: 350,
         emptyText: 'Keine Kommentare gefunden.',
@@ -46,8 +46,8 @@
         ];
         this.columns = [
             {header: 'Erzeuger', dataIndex: 'erzeuger'},
-            {header: 'Datum', dataIndex: 'kdatum'},
-            {header: 'Text', dataIndex: 'ktext', flex: 1}
+            {header: 'Datum', dataIndex: 'datum'},
+            {header: 'Text', dataIndex: 'text', flex: 1}
         ];
         this.callParent(arguments);
     }
--- a/app/view/orte/CreateForm.js	Fri Oct 31 21:11:25 2014 +0100
+++ b/app/view/orte/CreateForm.js	Fri Oct 31 21:28:31 2014 +0100
@@ -31,7 +31,7 @@
                         if (field.up('window')) {
                             field.up('window').down('fieldset').show();
                         }
-                        var orte = Ext.getStore('Ortedetails');
+                        var orte = Ext.getStore('StaOrte');
                         var ort = orte.getById(newv);
                         var fields = ['beschreibung', 'bezeichnung', 'hoeheLand',
                                       'latitude', 'longitude', 'staatId', 'gemId'];
@@ -40,7 +40,7 @@
                         // is needed as without having this record the field
                         // would only display the raw value (id) of the
                         // verwaltungseinheit.
-                        var verw = Ext.getStore('Verwaltungseinheiten');
+                        var verw = Ext.getStore('StaVerwaltungseinheiten');
                         if (ort) {
                             verw.load({
                                 id: ort.get('gemId')
--- a/app/view/orte/List.js	Fri Oct 31 21:11:25 2014 +0100
+++ b/app/view/orte/List.js	Fri Oct 31 21:28:31 2014 +0100
@@ -23,6 +23,10 @@
     },
     probeId: null,
     initComponent: function() {
+        this.store = Ext.data.StoreManager.get('Orte');
+        if (!this.store) {
+            this.store = Ext.create('Lada.store.Orte');
+        }
         this.dockedItems = [
             {
                 xtype: 'toolbar',
@@ -51,8 +55,10 @@
                 header: 'Staat',
                 dataIndex: 'ortId',
                 renderer: function(value) {
-                    var store = Ext.getStore('Ortedetails');
-                    var staaten = Ext.getStore('Staaten');
+                    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'));
                     return record.get('staatIso');
                 }
@@ -62,7 +68,8 @@
                 header: 'Gemeineschlüssel',
                 dataIndex: 'ortId',
                 renderer: function(value) {
-                    var store = Ext.getStore('Ortedetails');
+                    var store = Ext.getStore('StaOrte');
+                    console.log('value ' + value);
                     var record = store.getById(value);
                     return record.get('gemId');
                 }
@@ -73,11 +80,11 @@
                 dataIndex: 'ortId',
                 flex: 1,
                 renderer: function(value) {
-                    var store = Ext.getStore('Ortedetails');
-                    var gemeinden = Ext.getStore('Verwaltungseinheiten');
+                    var store = Ext.getStore('StaOrte');
+                    var gemeinden = Ext.getStore('StaVerwaltungseinheiten');
                     var record = store.getById(value);
                     var gemid = record.get('gemId');
-                    var record2 = gemeinden.findRecord("gemId", gemid);
+                    var record2 = gemeinden.getById(gemid);
                     return record2.get('bezeichnung');
                 }
 
@@ -86,7 +93,7 @@
                 header: 'Messpunkt',
                 dataIndex: 'ortId',
                 renderer: function(value) {
-                    var store = Ext.getStore('Ortedetails');
+                    var store = Ext.getStore('StaOrte');
                     var record = store.getById(value);
                     return record.get('bezeichnung');
                 }
--- a/app/view/proben/Edit.js	Fri Oct 31 21:11:25 2014 +0100
+++ b/app/view/proben/Edit.js	Fri Oct 31 21:28:31 2014 +0100
@@ -11,6 +11,7 @@
  */
 Ext.define('Lada.view.proben.Edit', {
     extend: 'Ext.window.Window',
+    require: ['Lada.view.proben.EditForm'],
     alias: 'widget.probenedit',
 
     title: 'Maske für §3-Proben',
@@ -21,6 +22,7 @@
     modal: true,
 
     initComponent: function() {
+        console.log('open edit...');
         this.buttons = [
             {
                 text: 'Speichern',
--- a/app/view/status/CreateForm.js	Fri Oct 31 21:11:25 2014 +0100
+++ b/app/view/status/CreateForm.js	Fri Oct 31 21:28:31 2014 +0100
@@ -31,12 +31,12 @@
             {
                 xtype: 'datetime',
                 label: 'Datum',
-                name: 'sdatum'
+                name: 'datum'
             },
             {
                 xtype: 'textarea',
                 label: 'Kommentar',
-                name: 'skommentar'
+                name: 'kommentar'
             }
         ];
         this.callParent();
--- a/app/view/status/List.js	Fri Oct 31 21:11:25 2014 +0100
+++ b/app/view/status/List.js	Fri Oct 31 21:28:31 2014 +0100
@@ -47,8 +47,8 @@
         this.columns = [
             {header: 'Erzeuger', dataIndex: 'erzeuger'},
             {header: 'Status', dataIndex: 'status'},
-            {header: 'Datum', dataIndex: 'sdatum'},
-            {header: 'Text', dataIndex: 'stext', flex: 1}
+            {header: 'Datum', dataIndex: 'datum'},
+            {header: 'Text', dataIndex: 'kommentar', flex: 1}
         ];
         this.callParent(arguments);
     }
--- a/app/view/widgets/Betriebsart.js	Fri Oct 31 21:11:25 2014 +0100
+++ b/app/view/widgets/Betriebsart.js	Fri Oct 31 21:28:31 2014 +0100
@@ -18,13 +18,14 @@
  * Combobox for Betriebsart
  */
 Ext.define('Lada.view.widgets.Betriebsart' ,{
-        extend: 'Ext.form.ComboBox',
-        alias: 'widget.betriebsart',
-        store: betriebsartStore,
-        queryMode: 'local',
-        displayField:'betriebsart',
-        valueField: 'betriebsartId',
-        emptyText:'Wählen Sie eine Betriebsart',
+    extend: 'Ext.form.ComboBox',
+    alias: 'widget.betriebsart',
+    store: betriebsartStore,
+    queryMode: 'local',
+    displayField:'betriebsart',
+    valueField: 'betriebsartId',
+    emptyText:'Wählen Sie eine Betriebsart',
+
     initComponent: function() {
         this.callParent(arguments);
     }
--- a/app/view/widgets/Datenbasis.js	Fri Oct 31 21:11:25 2014 +0100
+++ b/app/view/widgets/Datenbasis.js	Fri Oct 31 21:28:31 2014 +0100
@@ -6,41 +6,29 @@
  * the documentation coming with IMIS-Labordaten-Application for details. 
  */
 
-var datenbasisStore = Ext.create('Ext.data.Store', {
-    fields: ['datenbasisId', 'beschreibung', 'datenbasis'],
-    sorters: [{
-        property: 'datenbasis'
-    }],
-    autoLoad: true,
-    proxy: {
-        type: 'ajax',
-        api: {
-        read: 'server/rest/datenbasis'
-        },
-        reader: {
-            type: 'json',
-            root: 'data'
-        }
-    }
-});
-
 /**
  * Combobox for Datenbasis
  */
 Ext.define('Lada.view.widgets.Datenbasis' ,{
-        extend: 'Ext.form.ComboBox',
-        alias: 'widget.datenbasis',
-        store: datenbasisStore,
-        displayField:'datenbasis',
-        valueField: 'datenbasisId',
-        emptyText:'Wählen Sie eine Datenbasis',
-        // Enable filtering of comboboxes
-        autoSelect: false,
-        queryMode: 'local',
-        triggerAction : 'all',
-        typeAhead: false,
-        minChars: 0,
+    extend: 'Ext.form.ComboBox',
+    require: ['Lada.store.StaDatenbasen'],
+    alias: 'widget.datenbasis',
+    store: 'StaDatenbasen',
+    displayField:'datenbasis',
+    valueField: 'id',
+    emptyText:'Wählen Sie eine Datenbasis',
+    // Enable filtering of comboboxes
+    autoSelect: false,
+    queryMode: 'local',
+    triggerAction : 'all',
+    typeAhead: false,
+    minChars: 0,
+
     initComponent: function() {
+        this.store = Ext.data.StoreManager.get('StaDatenbasen');
+        if (!this.store) {
+            this.store = Ext.create('Lada.store.StaDatenbasen');
+        }
         this.callParent(arguments);
     }
 });
--- a/app/view/widgets/Datetime.js	Fri Oct 31 21:11:25 2014 +0100
+++ b/app/view/widgets/Datetime.js	Fri Oct 31 21:28:31 2014 +0100
@@ -10,10 +10,11 @@
  * Datetimepicker with german date format.
  */
 Ext.define('Lada.view.widgets.Datetime' ,{
-        extend: 'Ext.ux.form.DateTimeField',
-        alias: 'widget.datetime',
-        format: 'd.m.Y',
-        emptyText:'Wählen Sie einen Zeitpunkt',
+    extend: 'Ext.ux.form.DateTimeField',
+    alias: 'widget.datetime',
+    format: 'd.m.Y',
+    emptyText:'Wählen Sie einen Zeitpunkt',
+
     initComponent: function() {
         this.callParent(arguments);
     }
--- a/app/view/widgets/LadaForm.js	Fri Oct 31 21:11:25 2014 +0100
+++ b/app/view/widgets/LadaForm.js	Fri Oct 31 21:28:31 2014 +0100
@@ -101,7 +101,7 @@
             var url = baseUrl;
             var method = "POST";
             if (this.model.getId()) {
-                url += this.model.getEidi();
+                url += this.model.getId();
                 method = "PUT";
             }
 
--- a/app/view/widgets/Messeinheit.js	Fri Oct 31 21:11:25 2014 +0100
+++ b/app/view/widgets/Messeinheit.js	Fri Oct 31 21:28:31 2014 +0100
@@ -10,19 +10,24 @@
  * Combobox for Messeinheit
  */
 Ext.define('Lada.view.widgets.Messeinheit' ,{
-        extend: 'Ext.form.ComboBox',
-        alias: 'widget.messeinheit',
-        store: 'Messeinheit',
-        displayField: 'einheit',
-        valueField: 'mehId',
-        emptyText:'Wählen Sie eine Messeinheit',
-        // Enable filtering of comboboxes
-        autoSelect: false,
-        queryMode: 'local',
-        triggerAction : 'all',
-        typeAhead: false,
-        minChars: 0,
+    extend: 'Ext.form.ComboBox',
+    require: ['Lada.store.StaMesseinheiten'],
+    alias: 'widget.messeinheit',
+    store: 'StaMesseinheiten',
+    displayField: 'einheit',
+    valueField: 'id',
+    emptyText:'Wählen Sie eine Messeinheit',
+    // Enable filtering of comboboxes
+    autoSelect: false,
+    queryMode: 'local',
+    triggerAction : 'all',
+    typeAhead: false,
+    minChars: 0,
     initComponent: function() {
+        this.store = Ext.data.StoreManager.get('StaMesseinheiten');
+        if (!this.store) {
+            this.store = Ext.create('Lada.store.StaMesseinheiten');
+        }
         this.callParent(arguments);
     }
 });
--- a/app/view/widgets/Messgroesse.js	Fri Oct 31 21:11:25 2014 +0100
+++ b/app/view/widgets/Messgroesse.js	Fri Oct 31 21:28:31 2014 +0100
@@ -10,20 +10,25 @@
  * Combobox for Messgroesse
  */
 Ext.define('Lada.view.widgets.Messgroesse' ,{
-        extend: 'Ext.form.ComboBox',
-        alias: 'widget.messgroesse',
-        store: 'Messgroessen',
-        displayField: 'messgroesse',
-        valueField: 'messgroesseId',
-        emptyText:'Wählen Sie eine Messgröße',
-        // Enable filtering of comboboxes
-        autoSelect: false,
-        queryMode: 'local',
-        triggerAction : 'all',
-        typeAhead: false,
-        minChars: 0,
+    extend: 'Ext.form.ComboBox',
+    require: ['Lada.store.StaMessgroessen'],
+    alias: 'widget.messgroesse',
+    store: 'StaMessgroessen',
+    displayField: 'messgroesse',
+    valueField: 'id',
+    emptyText:'Wählen Sie eine Messgröße',
+    // Enable filtering of comboboxes
+    autoSelect: false,
+    queryMode: 'local',
+    triggerAction : 'all',
+    typeAhead: false,
+    minChars: 0,
 
     initComponent: function() {
+        this.store = Ext.data.StoreManager.get('StaMessgroessen');
+        if (!this.store) {
+            this.store = Ext.create('Lada.store.StaMessgroessen');
+        }
         this.callParent(arguments);
     }
 });
--- a/app/view/widgets/Messmethode.js	Fri Oct 31 21:11:25 2014 +0100
+++ b/app/view/widgets/Messmethode.js	Fri Oct 31 21:28:31 2014 +0100
@@ -6,42 +6,29 @@
  * the documentation coming with IMIS-Labordaten-Application for details. 
  */
 
-var mmtStore = Ext.create('Ext.data.Store', {
-    fields: ['mmtId', 'messmethode'],
-    sorters: [{
-        property: 'mmtId'
-    }],
-    autoLoad: true,
-    proxy: {
-        type: 'ajax',
-        api: {
-        read: 'server/rest/messmethode'
-        },
-        reader: {
-            type: 'json',
-            root: 'data'
-        }
-    }
-});
-
 /**
  * Combobox for Messmethode
  */
 Ext.define('Lada.view.widgets.Messmethode' ,{
-        tpl: '<tpl for="."><div class="x-combo-list-item x-boundlist-item" >{mmtId} - {messmethode}</div></tpl>',
-        extend: 'Ext.form.ComboBox',
-        alias: 'widget.messmethode',
-        store: mmtStore,
-        displayField:'messmethode',
-        valueField: 'mmtId',
-        emptyText:'Wählen Sie eine Messmethode',
-        // Enable filtering of comboboxes
-        autoSelect: false,
-        queryMode: 'local',
-        triggerAction : 'all',
-        typeAhead: false,
-        minChars: 0,
+    extend: 'Ext.form.ComboBox',
+    require: ['Lada.store.StaMessmethoden'],
+    alias: 'widget.messmethode',
+    store: 'StaMessmethoden',
+    displayField:'messmethode',
+    valueField: 'id',
+    emptyText:'Wählen Sie eine Messmethode',
+    // Enable filtering of comboboxes
+    autoSelect: false,
+    queryMode: 'local',
+    triggerAction : 'all',
+    typeAhead: false,
+    minChars: 0,
+    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');
+        if (!this.store) {
+            this.store = Ext.create('Lada.store.StaMessmethoden');
+        }
         this.callParent(arguments);
     }
 });
--- a/app/view/widgets/Mst.js	Fri Oct 31 21:11:25 2014 +0100
+++ b/app/view/widgets/Mst.js	Fri Oct 31 21:28:31 2014 +0100
@@ -6,42 +6,29 @@
  * the documentation coming with IMIS-Labordaten-Application for details. 
  */
 
-var mstStore = Ext.create('Ext.data.Store', {
-    fields: ['mstId', 'messStelle'],
-    sorters: [{
-        property: 'messStelle'
-    }],
-    autoLoad: true,
-    proxy: {
-        type: 'ajax',
-        api: {
-        read: 'server/rest/mst'
-        },
-        reader: {
-            type: 'json',
-            root: 'data'
-        }
-    }
-});
-
 /**
  * Combobox for Messstelle
  */
 Ext.define('Lada.view.widgets.Mst' ,{
-        extend: 'Ext.form.ComboBox',
-        alias: 'widget.mst',
-        store: mstStore,
-        displayField:'messStelle',
-        valueField: 'mstId',
-        typeAhead: false,
-        emptyText:'Wählen Sie eine Messstelle',
-        // Enable filtering of comboboxes
-        autoSelect: false,
-        queryMode: 'local',
-        triggerAction : 'all',
-        typeAhead: false,
-        minChars: 0,
+    extend: 'Ext.form.ComboBox',
+    require: ['Lada.store.StaMessstellen'],
+    alias: 'widget.mst',
+    store: 'StaMessstellen',
+    displayField:'messStelle',
+    valueField: 'id',
+    typeAhead: false,
+    emptyText:'Wählen Sie eine Messstelle',
+    // Enable filtering of comboboxes
+    autoSelect: false,
+    queryMode: 'local',
+    triggerAction : 'all',
+    typeAhead: false,
+    minChars: 0,
     initComponent: function() {
+        this.store = Ext.data.StoreManager.get('StaMessstellen');
+        if (!this.store) {
+            this.store = Ext.create('Lada.store.StaMessstellen');
+        }
         this.callParent(arguments);
     }
 });
--- a/app/view/widgets/Netzbetreiber.js	Fri Oct 31 21:11:25 2014 +0100
+++ b/app/view/widgets/Netzbetreiber.js	Fri Oct 31 21:28:31 2014 +0100
@@ -6,41 +6,28 @@
  * the documentation coming with IMIS-Labordaten-Application for details. 
  */
 
-var netzbetreiberStore = Ext.create('Ext.data.Store', {
-    fields: ['netzbetreiberId', 'netzbetreiber'],
-    sorters: [{
-        property: 'netzbetreiber'
-    }],
-    autoLoad: true,
-    proxy: {
-        type: 'ajax',
-        api: {
-        read: 'server/rest/netzbetreiber'
-        },
-        reader: {
-            type: 'json',
-            root: 'data'
-        }
-    }
-});
-
 /**
  * Combobox for Netzbetreiber
  */
 Ext.define('Lada.view.widgets.Netzbetreiber' ,{
-        extend: 'Ext.form.ComboBox',
-        alias: 'widget.netzbetreiber',
-        store: netzbetreiberStore,
-        displayField:'netzbetreiber',
-        valueField: 'netzbetreiberId',
-        emptyText:'Wählen Sie einen Netzbetreiber',
-        // Enable filtering of comboboxes
-        autoSelect: false,
-        queryMode: 'local',
-        triggerAction : 'all',
-        typeAhead: false,
-        minChars: 0,
+    extend: 'Ext.form.ComboBox',
+    require: ['Lada.store.StaNetzbetreiber'],
+    alias: 'widget.netzbetreiber',
+    store: 'StaNetzbetreiber',
+    displayField:'netzbetreiber',
+    valueField: 'id',
+    emptyText:'Wählen Sie einen Netzbetreiber',
+    // Enable filtering of comboboxes
+    autoSelect: false,
+    queryMode: 'local',
+    triggerAction : 'all',
+    typeAhead: false,
+    minChars: 0,
     initComponent: function() {
+        this.store = Ext.data.StoreManager.get('StaNetzbetreiber');
+        if (!this.store) {
+            this.store = Ext.create('Lada.store.StaNetzbetreiber');
+        }
         this.callParent(arguments);
     }
 });
--- a/app/view/widgets/Ortdetail.js	Fri Oct 31 21:11:25 2014 +0100
+++ b/app/view/widgets/Ortdetail.js	Fri Oct 31 21:28:31 2014 +0100
@@ -10,19 +10,24 @@
  * Combobox for Ortdetails
  */
 Ext.define('Lada.view.widgets.Ortdetail' ,{
-        extend: 'Ext.form.ComboBox',
-        alias: 'widget.ortdetail',
-        store: 'Ortedetails',
-        displayField: 'bezeichnung',
-        valueField: 'ortId',
-        emptyText:'Wählen Sie einen Ort',
-        // Enable filtering of comboboxes
-        autoSelect: false,
-        queryMode: 'local',
-        triggerAction : 'all',
-        typeAhead: false,
-        minChars: 0,
+    extend: 'Ext.form.ComboBox',
+    require: ['Lada.store.StaOrte'],
+    alias: 'widget.ortdetail',
+    store: 'StaOrte',
+    displayField: 'bezeichnung',
+    valueField: 'id',
+    emptyText:'Wählen Sie einen Ort',
+    // Enable filtering of comboboxes
+    autoSelect: false,
+    queryMode: 'local',
+    triggerAction : 'all',
+    typeAhead: false,
+    minChars: 0,
     initComponent: function() {
+        this.store = Ext.data.StoreManager.get('StaOrte');
+        if (!this.store) {
+            this.store = Ext.create('Lada.store.StaOrte');
+        }
         this.callParent(arguments);
     }
 });
--- a/app/view/widgets/Probenart.js	Fri Oct 31 21:11:25 2014 +0100
+++ b/app/view/widgets/Probenart.js	Fri Oct 31 21:28:31 2014 +0100
@@ -6,38 +6,28 @@
  * the documentation coming with IMIS-Labordaten-Application for details. 
  */
 
-var probenartStore = Ext.create('Ext.data.Store', {
-    fields: ['probenartId', 'probenart'],
-    autoLoad: true,
-    proxy: {
-        type: 'ajax',
-        api: {
-        read: 'server/rest/probenart'
-        },
-        reader: {
-            type: 'json',
-            root: 'data'
-        }
-    }
-});
-
 /**
  * Combobox for Probenart
  */
 Ext.define('Lada.view.widgets.Probenart' ,{
-        extend: 'Ext.form.ComboBox',
-        alias: 'widget.probenart',
-        store: probenartStore,
-        displayField:'probenart',
-        valueField: 'probenartId',
-        emptyText:'Wählen Sie eine Probenart',
-        // Enable filtering of comboboxes
-        autoSelect: false,
-        queryMode: 'local',
-        triggerAction : 'all',
-        typeAhead: false,
-        minChars: 0,
+    extend: 'Ext.form.ComboBox',
+    require: ['Lada.store.StaProbenarten'],
+    alias: 'widget.probenart',
+    store: 'StaProbenarten',
+    displayField:'probenart',
+    valueField: 'id',
+    emptyText:'Wählen Sie eine Probenart',
+    // Enable filtering of comboboxes
+    autoSelect: false,
+    queryMode: 'local',
+    triggerAction : 'all',
+    typeAhead: false,
+    minChars: 0,
     initComponent: function() {
+        this.store = Ext.data.StoreManager.get('StaProbenarten');
+        if (!this.store) {
+            this.store = Ext.create('Lada.store.StaProbenarten');
+        }
         this.callParent(arguments);
     }
 });
--- a/app/view/widgets/Probenzusatzwert.js	Fri Oct 31 21:11:25 2014 +0100
+++ b/app/view/widgets/Probenzusatzwert.js	Fri Oct 31 21:28:31 2014 +0100
@@ -10,19 +10,24 @@
  * Combobox for Zusatzwert
  */
 Ext.define('Lada.view.widgets.Probenzusatzwert' ,{
-        extend: 'Ext.form.ComboBox',
-        alias: 'widget.probenzusatzwert',
-        store: 'Probenzusatzwerte',
-        displayField: 'beschreibung',
-        valueField: 'pzsId',
-        emptyText:'Wählen Sie einen Zusatzwert',
-        // Enable filtering of comboboxes
-        autoSelect: false,
-        queryMode: 'local',
-        triggerAction : 'all',
-        typeAhead: false,
-        minChars: 0,
+    extend: 'Ext.form.ComboBox',
+    require: ['Lada.store.StaProbenzusaetze'],
+    alias: 'widget.probenzusatzwert',
+    store: 'StaProbenzusaetze',
+    displayField: 'beschreibung',
+    valueField: 'id',
+    emptyText:'Wählen Sie einen Zusatzwert',
+    // Enable filtering of comboboxes
+    autoSelect: false,
+    queryMode: 'local',
+    triggerAction : 'all',
+    typeAhead: false,
+    minChars: 0,
     initComponent: function() {
+        this.store = Ext.data.StoreManager.get('StaProbenzusaetze');
+        if (!this.store) {
+            this.store = Ext.create('Lada.store.StaProbenzusaetze');
+        }
         this.callParent(arguments);
     }
 });
--- a/app/view/widgets/Staat.js	Fri Oct 31 21:11:25 2014 +0100
+++ b/app/view/widgets/Staat.js	Fri Oct 31 21:28:31 2014 +0100
@@ -10,19 +10,24 @@
  * Combobox for Staat
  */
 Ext.define('Lada.view.widgets.Staat' ,{
-        extend: 'Ext.form.ComboBox',
-        alias: 'widget.staat',
-        store: 'Staaten',
-        displayField: 'staat',
-        valueField: 'staatId',
-        emptyText:'Wählen Sie einen Staat',
-        // Enable filtering of comboboxes
-        autoSelect: false,
-        queryMode: 'local',
-        triggerAction : 'all',
-        typeAhead: false,
-        minChars: 0,
+    extend: 'Ext.form.ComboBox',
+    require: ['Lada.store.StaStaaten'],
+    alias: 'widget.staat',
+    store: 'StaStaaten',
+    displayField: 'staat',
+    valueField: 'id',
+    emptyText:'Wählen Sie einen Staat',
+    // Enable filtering of comboboxes
+    autoSelect: false,
+    queryMode: 'local',
+    triggerAction : 'all',
+    typeAhead: false,
+    minChars: 0,
     initComponent: function() {
+        this.store = Ext.data.StoreManager.get('StaStaaten');
+        if (!this.store) {
+            this.store = Ext.create('Lada.store.StaStaaten');
+        }
         this.callParent(arguments);
     }
 });
--- a/app/view/widgets/Uwb.js	Fri Oct 31 21:11:25 2014 +0100
+++ b/app/view/widgets/Uwb.js	Fri Oct 31 21:28:31 2014 +0100
@@ -6,55 +6,42 @@
  * the documentation coming with IMIS-Labordaten-Application for details. 
  */
 
-var uwbStore = Ext.create('Ext.data.Store', {
-    fields: ['umwId', 'umweltBereich'],
-    sorters: [{
-        property: 'umwId'
-    }],
-    autoLoad: true,
-    proxy: {
-        type: 'ajax',
-        api: {
-        read: 'server/rest/uwb'
-        },
-        reader: {
-            type: 'json',
-            root: 'data'
-        }
-    }
-});
-
 /**
  * Combobox for Umweltbereich
  */
 Ext.define('Lada.view.widgets.Uwb' ,{
-        tpl: '<tpl for="."><div class="x-combo-list-item  x-boundlist-item" >{umwId} - {umweltBereich}</div></tpl>',
-        extend: 'Ext.form.ComboBox',
-        alias: 'widget.uwb',
-        store: uwbStore,
-        displayField:'umwId',
-        valueField: 'umwId',
-        emptyText:'Wählen Sie einen Umweltbereich',
-        // Enable filtering of comboboxes
-        autoSelect: false,
-        queryMode: 'local',
-        triggerAction : 'all',
-        typeAhead: false,
-        minChars: 0,
-        // TODO: Set value in disply after selection. Can not figure out why
-        // accessing the recored.data attribute fails here (ti) <2013-08-06 16:52> 
-        //listeners: {
-        //    select: function(combo, record, index) {
-        //        console.log("1");
-        //        console.log(record);
-        //        console.log("2");
-        //        var text = record.data['umwId'] + " - " + record.data['umweltBereich'];
-        //        console.log("3");
-        //        Ext.form.ComboBox.superclass.setValue.call(this, text);
-        //        combo.value = record.id;
-        //    }
-        //},
+    extend: 'Ext.form.ComboBox',
+    require: ['Lada.store.StaUmwelt'],
+    alias: 'widget.uwb',
+    store: 'StaUmwelt',
+    displayField:'id',
+    valueField: 'id',
+    emptyText:'Wählen Sie einen Umweltbereich',
+    // Enable filtering of comboboxes
+    autoSelect: false,
+    queryMode: 'local',
+    triggerAction : 'all',
+    typeAhead: false,
+    minChars: 0,
+    tpl: '<tpl for="."><div class="x-combo-list-item  x-boundlist-item" >{id} - {umweltBereich}</div></tpl>',
+    // TODO: Set value in disply after selection. Can not figure out why
+    // accessing the recored.data attribute fails here (ti) <2013-08-06 16:52> 
+    //listeners: {
+    //    select: function(combo, record, index) {
+    //        console.log("1");
+    //        console.log(record);
+    //        console.log("2");
+    //        var text = record.data['umwId'] + " - " + record.data['umweltBereich'];
+    //        console.log("3");
+    //        Ext.form.ComboBox.superclass.setValue.call(this, text);
+    //        combo.value = record.id;
+    //    }
+    //},
     initComponent: function() {
+        this.store = Ext.data.StoreManager.get('StaUmwelt');
+        if (!this.store) {
+            this.store = Ext.create('Lada.store.StaUmwelt');
+        }
         this.callParent(arguments);
     }
 });
--- a/app/view/widgets/Verwaltungseinheit.js	Fri Oct 31 21:11:25 2014 +0100
+++ b/app/view/widgets/Verwaltungseinheit.js	Fri Oct 31 21:28:31 2014 +0100
@@ -10,20 +10,26 @@
  * Combobox for Verwaltungseinheit
  */
 Ext.define('Lada.view.widgets.Verwaltungseinheit' ,{
-        extend: 'Ext.form.ComboBox',
-        alias: 'widget.verwaltungseinheiten',
-        store: 'Verwaltungseinheiten',
-        displayField: 'bezeichnung',
-        valueField: 'gemId',
-        emptyText:'Wählen Sie eine Verwaltungseinheit',
-        hideTrigger: true,
-        // Enable filtering of comboboxes
-        autoSelect: false,
-        queryMode: 'remote',
-        triggerAction : 'type',
-        typeAhead: false,
-        minChars: 2,
+    extend: 'Ext.form.field.ComboBox',
+    require: ['Lada.store.StaVerwaltungseinheiten'],
+    alias: 'widget.verwaltungseinheiten',
+    store: 'StaVerwaltungseinheiten',
+    displayField: 'bezeichnung',
+    valueField: 'id',
+    emptyText:'Wählen Sie eine Verwaltungseinheit',
+    hideTrigger: true,
+    // Enable filtering of comboboxes
+    autoSelect: false,
+    queryMode: 'remote',
+    triggerAction : 'type',
+    typeAhead: false,
+    minChars: 2,
+
     initComponent: function() {
+        this.store = Ext.data.StoreManager.get('StaVerwaltungseinheiten');
+        if (!this.store) {
+            this.store = Ext.create('Lada.store.StaVerwaltungseinheiten');
+        }
         this.callParent(arguments);
     },
     // This listener is used to load currently "selected" verwaltungseinheit.
--- a/app/view/zusatzwerte/List.js	Fri Oct 31 21:11:25 2014 +0100
+++ b/app/view/zusatzwerte/List.js	Fri Oct 31 21:28:31 2014 +0100
@@ -45,13 +45,13 @@
         this.columns = [
             {
                 header: 'PZW-ID',
-                dataIndex: 'pzsId'
+                dataIndex: 'id'
             },
             {
                 header: 'PZW-Größe',
                 dataIndex: 'pzsId',
                 renderer: function(value) {
-                    var store = Ext.getStore('Probenzusatzwerte');
+                    var store = Ext.getStore('StaProbenzusaetze');
                     var record = store.getById(value);
                     return record.get('beschreibung');
                 },
@@ -59,7 +59,7 @@
             },
             {
                 header: 'Messwert',
-                dataIndex: 'pzsId',
+                dataIndex: 'id',
                 renderer: function(value) {
                     var store = Ext.getStore('Zusatzwerte');
                     var record = store.getById(value);
@@ -77,10 +77,11 @@
                 header: 'Maßeinheit',
                 dataIndex: 'pzsId',
                 renderer: function(value) {
-                    var zstore = Ext.getStore('Probenzusatzwerte');
-                    var mstore = Ext.getStore('Messeinheit');
+                    var zstore = Ext.getStore('StaProbenzusaetze');
+                    var mstore = Ext.getStore('StaMesseinheiten');
+                    console.log('store: ' + mstore);
                     var mehId = zstore.getById(value).get('mehId');
-                    var record = mstore.findRecord('mehId', mehId);
+                    var record = mstore.findRecord('id', mehId);
                     return record.get('einheit');
                 }
             }

http://lada.wald.intevation.org