[Lada-commits] [PATCH 3 of 5] Made kommentare-grids more robust
Wald Commits
scm-commit at wald.intevation.org
Tue Nov 10 13:09:34 CET 2015
# HG changeset patch
# User Dustin Demuth <dustin at intevation.de>
# Date 1447149186 -3600
# Node ID 841196768e8631fc95a9452cc42407791cee0448
# Parent 5d57c6c53e20ceabfa66541fbb18d190a6c6420d
Made kommentare-grids more robust
diff -r 5d57c6c53e20 -r 841196768e86 app/view/grid/MKommentar.js
--- 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',
diff -r 5d57c6c53e20 -r 841196768e86 app/view/grid/PKommentar.js
--- a/app/view/grid/PKommentar.js Tue Nov 10 09:50:06 2015 +0100
+++ b/app/view/grid/PKommentar.js Tue Nov 10 10:53:06 2015 +0100
@@ -75,12 +75,16 @@
dataIndex: 'erzeuger',
width: 140,
renderer: function(value) {
+ var r = '';
if (!value || value === '') {
- return '';
+ r = 'Error';
}
var store = Ext.data.StoreManager.get('messstellen');
var record = store.getById(value);
- return record.get('messStelle');
+ if (record) {
+ r = record.get('messStelle');
+ }
+ return r;
},
editor: {
xtype: 'combobox',
More information about the Lada-commits
mailing list