diff app/view/grid/Status.js @ 958:5d57c6c53e20

Made the grids more robust against erroneous data
author Dustin Demuth <dustin@intevation.de>
date Tue, 10 Nov 2015 09:50:06 +0100
parents 881984972e0e
children 6f1cc3316e2d
line wrap: on
line diff
--- a/app/view/grid/Status.js	Mon Nov 09 14:13:27 2015 +0100
+++ b/app/view/grid/Status.js	Tue Nov 10 09:50:06 2015 +0100
@@ -47,9 +47,9 @@
         this.plugins = [this.rowEditing];
 
         var statusWerteStore = Ext.create('Lada.store.StatusWerte');
-        statusWerteStore.load();
+        statusWerteStore.load(); //add params messungid
         var statusStufeStore = Ext.create('Lada.store.StatusStufe');
-        statusStufeStore.load();
+        statusStufeStore.load(); //add params messungid
         this.dockedItems = [{
             xtype: 'toolbar',
             dock: 'bottom',
@@ -95,17 +95,14 @@
             header: 'Stufe',
             dataIndex: 'statusStufe',
             renderer: function(value) {
+                var r;
                 if (value===null || value === '') {
-                    return 'Fehlerhafte Daten';
+                    r = 'Error';
                 }
                 var item = statusStufeStore.getById(value);
-                var r;
                 if (item) {
                     r = item.get('stufe');
                 }
-                if (r === null) {
-                    r = 'Error';
-                }
                 return r;
             },
             editor: {
@@ -121,17 +118,14 @@
             header: 'Status',
             dataIndex: 'statusWert',
             renderer: function(value) {
+                var r;
                 if (value===null || value === '') {
-                    return '';
+                    r = 'Error';
                 }
                 var item = statusWerteStore.getById(value);
-                var r;
                 if (item) {
                     r = item.get('wert');
                 }
-                if (r === null) {
-                    r = 'Error';
-                }
                 return r;
             },
             editor: {

http://lada.wald.intevation.org