diff app/view/grid/Messung.js @ 1185:90ae675a1224 schema-update

Updated client status workflow and model.
author Raimund Renkert <raimund.renkert@intevation.de>
date Wed, 31 Aug 2016 15:58:49 +0200
parents a73726bba79c
children
line wrap: on
line diff
--- a/app/view/grid/Messung.js	Wed Aug 31 15:58:19 2016 +0200
+++ b/app/view/grid/Messung.js	Wed Aug 31 15:58:49 2016 +0200
@@ -75,36 +75,40 @@
         }, {
             header: 'Status',
             flex: 1,
-            dataIndex: 'statusWert',
+            dataIndex: 'statusKombi',
             renderer: function(value, meta, record, rNdx, cNdx) {
                 var statusId = record.get('status');
                 var mId = record.get('id');
                 //also fwd the record to the asynchronous loading of statuswerte
                 // in order to add the statuswert to the record,
                 // after the grid was rendered...
-                if (value === '') {
+                if (!value || value === '') {
                     this.updateStatus(mId, statusId, record);
                     return 'Lade...';
                 }
-                var sta = Ext.data.StoreManager.getByKey('statuswerte');
-                return sta.getById(value).get('wert');
+                var kombis = Ext.data.StoreManager.get('statuskombi');
+                var kombi = kombis.getById(value);
+                var st = kombi.raw.statusWert.wert
+                return st;
             }
         }, {
             header: 'Stufe',
             flex: 1,
-            dataIndex: 'statusStufe',
+            dataIndex: 'statusKombi',
             renderer: function(value, meta, record, rNdx, cNdx) {
                 var statusId = record.get('status');
                 var mId = record.get('id');
                 //also fwd the record to the asynchronous loading of statuswerte
                 // in order to add the statuswert to the record,
                 // after the grid was rendered...
-                if (value === '') {
+                if (!value || value === '') {
                     this.updateStatus(mId, statusId, record);
                     return 'Lade...';
                 }
-                var sta = Ext.data.StoreManager.getByKey('statusstufe');
-                return sta.getById(value).get('stufe');
+                var kombis = Ext.data.StoreManager.get('statuskombi');
+                var kombi = kombis.getById(value);
+                var st = kombi.raw.statusStufe.stufe
+                return st;
             }
         }, {
             header: 'OK-Flag',
@@ -252,14 +256,12 @@
         else {
             var rec = sstore.getById(opts.statusId);
             if (rec) {
-                value = rec.get('statusWert');
-                var stufe = rec.get('statusStufe');
+                value = rec.get('statusKombi');
                 //add the determined statuswert to the record.
                 // this is necessary to let the controller determine
                 // which actions are allowed.
                 opts.record.beginEdit();
-                opts.record.set('statusWert', value);
-                opts.record.set('statusStufe', stufe);
+                opts.record.set('statusKombi', value);
                 opts.record.endEdit();
             }
         }

http://lada.wald.intevation.org