Mercurial > lada > lada-client
changeset 1080:15d7b7a9e177
Override getValue for Netzbetreiber Combobox to allways return the correct
value.
author | Raimund Renkert <raimund.renkert@intevation.de> |
---|---|
date | Wed, 13 Apr 2016 16:10:25 +0200 |
parents | 1c86a259c2ac |
children | 5e9a674d7bb4 |
files | app/view/widget/Netzbetreiber.js app/view/widget/Status.js app/view/widget/base/ComboBox.js resources/css/lada.css resources/i18n/Lada_de-DE.properties |
diffstat | 5 files changed, 48 insertions(+), 7 deletions(-) [+] |
line wrap: on
line diff
--- a/app/view/widget/Netzbetreiber.js Wed Apr 13 13:57:36 2016 +0200 +++ b/app/view/widget/Netzbetreiber.js Wed Apr 13 16:10:25 2016 +0200 @@ -34,5 +34,28 @@ this.store.clearFilter(); } this.callParent(arguments); + }, + + getValue: function() { + var value = this.down('combobox').getValue(); + if (value instanceof Array) { + return value; + } + value = value.trim().split(' '); + var retValues = []; + for (var i = 0; i < value.length; i++) { + var item = value[i]; + var found = this.store.queryBy(function(rec) { + if (rec.get('id') == item || + rec.get('netzbetreiber') == item) { + return true; + } + }); + if (found.getCount() >= 0) { + retValues.push(found.getAt(0).get('id')); + continue; + } + } + return retValues; } });
--- a/app/view/widget/Status.js Wed Apr 13 13:57:36 2016 +0200 +++ b/app/view/widget/Status.js Wed Apr 13 16:10:25 2016 +0200 @@ -10,16 +10,19 @@ fields: ['id', 'status'], data: [{ 'id': 1, - 'status': 'nicht vergeben' - }, { - 'id': 2, 'status': 'plausibel' }, { - 'id': 3, + 'id': 2, 'status': 'nicht repräsentativ' }, { - 'id': 4, + 'id': 3, 'status': 'nicht plausibel' + }, { + 'id': 7, + 'status': 'nicht lieferbar' + }, { + 'id': 8, + 'status': 'zurücksetzen' }] });
--- a/app/view/widget/base/ComboBox.js Wed Apr 13 13:57:36 2016 +0200 +++ b/app/view/widget/base/ComboBox.js Wed Apr 13 16:10:25 2016 +0200 @@ -20,6 +20,10 @@ margin: '0, 0, 5, 0', initComponent: function() { + console.log(this.editable); + if (this.editable === undefined) { + this.editable = true; + } this.items = [{ xtype: 'combobox', flex: 1, @@ -39,7 +43,7 @@ minChars: this.minChars, maxChars: this.maxChars, multiSelect: this.multiSelect, - editable: this.editable || true, + editable: this.editable, readOnly: this.readOnly, forceSelection: this.forceSelection || false, msgTarget: 'none',
--- a/resources/css/lada.css Wed Apr 13 13:57:36 2016 +0200 +++ b/resources/css/lada.css Wed Apr 13 16:10:25 2016 +0200 @@ -33,11 +33,21 @@ background-image: url(../img/view-time-schedule-baselined.png); } +.x-action-col-cell img.noeditstatus +{ + background-image: url(../img/view-time-schedule-baselined-status.png); +} + .x-action-col-cell img.edit { background-image: url(../img/view-time-schedule-edit.png); } +.x-action-col-cell img.editstatus +{ + background-image: url(../img/view-time-schedule-edit-status.png); +} + .x-grid-checkheader { height: 16px; background-image: url('images/unchecked.gif');
--- a/resources/i18n/Lada_de-DE.properties Wed Apr 13 13:57:36 2016 +0200 +++ b/resources/i18n/Lada_de-DE.properties Wed Apr 13 16:10:25 2016 +0200 @@ -2,7 +2,7 @@ # Error Codes ## ! General errors -200:Unbekannter Fehler +200:OK 601:Probe existiert bereits 602:Objekt ist keine Probe 603:Fehler in der Verbindung zur DB @@ -48,6 +48,7 @@ stammdaten:Stammdaten probe:Probe +messung:Messung name:Name mstId:Messstelle datenbasisId:Datenbasis