[Lada-commits] [PATCH 2 of 2] Display Messungen query mode and use the new messung list grid

Wald Commits scm-commit at wald.intevation.org
Fri Apr 8 19:33:59 CEST 2016


# HG changeset patch
# User Raimund Renkert <raimund.renkert at intevation.de>
# Date 1460136826 -7200
# Node ID 2a5d42045c63dddbdfaac2277a5c2f31b7674849
# Parent  e32c10cf5499b13e7844cd0ce8691efac553f312
Display Messungen query mode and use the new messung list grid.

diff -r e32c10cf5499 -r 2a5d42045c63 app.js
--- a/app.js	Fri Apr 08 19:32:02 2016 +0200
+++ b/app.js	Fri Apr 08 19:33:46 2016 +0200
@@ -207,6 +207,10 @@
             storeId: 'probequeries',
             autoLoad: 'true'
         });
+        Ext.create('Lada.store.MessungQueries', {
+            storeId: 'messungqueries',
+            autoLoad: 'true'
+        });
         Ext.create('Lada.store.MessprogrammQueries', {
             storeId: 'messprogrammqueries',
             autoLoad: 'true'
@@ -267,6 +271,7 @@
         'Lada.controller.Map',
         'Lada.controller.Ort',
         'Lada.controller.grid.ProbeList',
+        'Lada.controller.grid.MessungList',
         'Lada.controller.grid.MessprogrammeList',
         'Lada.controller.grid.Datensatzerzeuger',
         'Lada.controller.grid.Probenehmer',
diff -r e32c10cf5499 -r 2a5d42045c63 app/controller/Filter.js
--- a/app/controller/Filter.js	Fri Apr 08 19:32:02 2016 +0200
+++ b/app/controller/Filter.js	Fri Apr 08 19:33:46 2016 +0200
@@ -17,6 +17,8 @@
         'Lada.view.widget.Messstelle',
         'Lada.view.grid.MessprogrammeList',
         'Lada.view.grid.ProbeList',
+        'Lada.view.grid.MessungList',
+        'Lada.store.MessungenList',
         'Lada.view.window.FilterManagement',
         'Lada.view.widget.Umwelt'
     ],
@@ -113,7 +115,9 @@
             this.displayFields.reverse();
         }
 
-        if (queryType == 'probe' || queryType == 'messprogramm') {
+        if (queryType == 'probe' ||
+            queryType == 'messung' ||
+            queryType == 'messprogramm') {
             // Dynamic Grids
             // We need to set both grid and Store.
             var frgrid; // The Resultgrid
@@ -124,6 +128,10 @@
                     gridstore = Ext.create('Lada.store.ProbenList');
                     frgrid = Ext.create('Lada.view.grid.ProbeList');
                     break;
+                case 'messung':
+                    gridstore = Ext.create('Lada.store.MessungenList');
+                    frgrid = Ext.create('Lada.view.grid.MessungList');
+                    break;
                 case 'messprogramm':
                     gridstore = Ext.create('Lada.store.MessprogrammeList');
                     frgrid = Ext.create('Lada.view.grid.MessprogrammeList');
@@ -326,6 +334,9 @@
             case 'probe':
                 sname = 'Lada.store.ProbenList';
                 break;
+            case 'messung':
+                sname = 'Lada.store.MessungenList';
+                break;
             case 'messprogramm':
                 sname = 'Lada.store.MessprogrammeList';
                 break;
@@ -456,6 +467,9 @@
         else if (this.mode === 'stammdaten') {
             store = Ext.StoreManager.get('stammdatenqueries');
         }
+        else if (this.mode === 'messungen') {
+            store = Ext.StoreManager.get('messungqueries');
+        }
         else {
             return;
         }
@@ -525,6 +539,9 @@
                     else if (query.get('type') === 'messprogramm') {
                         Ext.StoreManager.get('messprogrammqueries').load();
                     }
+                    else if (query.get('type') === 'messung') {
+                        Ext.StoreManager.get('messungqueries').load();
+                    }
                     else {
                         Ext.StoreManager.get('stammdatenqueries').load();
                     }
@@ -568,6 +585,9 @@
                     else if (query.get('type') === 'messprogramm') {
                         Ext.StoreManager.get('messprogrammqueries').reload();
                     }
+                    else if (query.get('type') === 'messung') {
+                        Ext.StoreManager.get('messungqueries').reload();
+                    }
                     else {
                         Ext.StoreManager.get('stammdatenqueries').reload();
                     }
diff -r e32c10cf5499 -r 2a5d42045c63 app/view/ModeSwitcher.js
--- a/app/view/ModeSwitcher.js	Fri Apr 08 19:32:02 2016 +0200
+++ b/app/view/ModeSwitcher.js	Fri Apr 08 19:33:46 2016 +0200
@@ -23,7 +23,7 @@
     initComponent: function() {
         var i18n = Lada.getApplication().bundle;
         this.title = i18n.getMsg('modus');
-        this.items= [{
+        this.items = [{
             xtype: 'radiogroup',
             columns: 1,
             width: '100%',
@@ -34,27 +34,38 @@
                 inputValue: 'proben', //this determines the store
                     // which will be loaded by the controller,
                 checked: true,
-                handler: function(field, state){
+                handler: function(field, state) {
                     if (state === true) {
                         this.fireEvent('check', field);
                     }
                 }
-            },{
+            }, {
+                xtype: 'radiofield',
+                name: 'modeswitch',
+                boxLabel: i18n.getMsg('messungen'),
+                inputValue: 'messungen', //this determines the store
+                    // which will be loaded by the controller,
+                handler: function(field, state) {
+                    if (state === true) {
+                        this.fireEvent('check', field);
+                    }
+                }
+            }, {
                 xtype: 'radiofield',
                 name: 'modeswitch',
                 boxLabel: i18n.getMsg('messprogramme'),
                 inputValue: 'messprogramme',
-                handler: function(field, state){
+                handler: function(field, state) {
                     if (state === true) {
                         this.fireEvent('check', field);
                     }
                 }
-            },{
+            }, {
                 xtype: 'radiofield',
                 name: 'modeswitch',
                 boxLabel: i18n.getMsg('stammdaten'),
                 inputValue: 'stammdaten',
-                handler: function(field, state){
+                handler: function(field, state) {
                     if (state === true) {
                         this.fireEvent('check', field);
                     }
diff -r e32c10cf5499 -r 2a5d42045c63 app/view/widget/DynamicGrid.js
--- a/app/view/widget/DynamicGrid.js	Fri Apr 08 19:32:02 2016 +0200
+++ b/app/view/widget/DynamicGrid.js	Fri Apr 08 19:33:46 2016 +0200
@@ -70,7 +70,7 @@
      * @return an array of two arrays: [0] is an array of colums [1] an array
      *   of fields
      **/
-     generateColumnsAndFields: function(cols) {
+    generateColumnsAndFields: function(cols) {
         var resultColumns = [];
         var fields = [];
 
@@ -103,13 +103,13 @@
         });
 
         for (var i = cols.length - 1; i >= 0; i--) {
-            if (cols[i] === 'id') {
+            fields.push(new Ext.data.Field({
+                name: cols[i].dataIndex
+            }));
+            if (cols[i] === 'id' || cols[i].dataIndex === 'probeId') {
                 continue;
             }
             resultColumns.push(cols[i]);
-            fields.push(new Ext.data.Field({
-                name: cols[i].dataIndex
-            }));
         }
         var caf = new Array();
         caf[0] = resultColumns;
diff -r e32c10cf5499 -r 2a5d42045c63 resources/i18n/Lada_de-DE.properties
--- a/resources/i18n/Lada_de-DE.properties	Fri Apr 08 19:32:02 2016 +0200
+++ b/resources/i18n/Lada_de-DE.properties	Fri Apr 08 19:33:46 2016 +0200
@@ -44,6 +44,7 @@
 modus:Modus
 messprogramme:Messprogramme
 proben:Proben
+messungen:Messungen
 stammdaten:Stammdaten
 
 probe:Probe
@@ -223,6 +224,12 @@
 probe.button.print:Auswahl drucken
 
 ##
+# MessungList Grid:
+##
+messung.emptyGrid:Keine Messung gefunden.
+messung.gridTitle:Messungen
+
+##
 # MessprogrammeList Grid:
 ##
 messprogramme.emptyGrid:Keine Messprogramme gefunden.
@@ -302,3 +309,6 @@
 querygrid.probe.title:Probenfilter
 querygrid.messprogramm.title:Messprogrammfilter
 querygrid.stammdaten.title:Stammdatenfilter
+
+statusSetzen:Status setzen
+statusSetzen.win.title:Status setzen


More information about the Lada-commits mailing list