diff app/view/grid/MKommentar.js @ 959:841196768e86

Made kommentare-grids more robust
author Dustin Demuth <dustin@intevation.de>
date Tue, 10 Nov 2015 10:53:06 +0100
parents 0a233865a9c3
children 6e67eb947258
line wrap: on
line diff
--- a/app/view/grid/MKommentar.js	Tue Nov 10 09:50:06 2015 +0100
+++ b/app/view/grid/MKommentar.js	Tue Nov 10 10:53:06 2015 +0100
@@ -68,11 +68,16 @@
             header: 'Erzeuger',
             dataIndex: 'erzeuger',
             renderer: function(value) {
+                var r = '';
                 if (!value || value === '') {
-                    return '';
+                    r = 'Error';
                 }
-                var mstore = Ext.data.StoreManager.get('messstellen');
-                return mstore.getById(value).get('messStelle');
+                var store = Ext.data.StoreManager.get('messstellen');
+                var record = store.getById(value);
+                if (record) {
+                  r = record.get('messStelle');
+                }
+                return r;
             },
             editor: {
                 xtype: 'combobox',

http://lada.wald.intevation.org