comparison app/view/form/Messung.js @ 1217:4270da0f7d3b

Merged branch schema-update into default.
author Tom Gottfried <tom@intevation.de>
date Fri, 14 Oct 2016 18:34:19 +0200
parents bb44ec8746f5
children 7e9a6f0e55b3
comparison
equal deleted inserted replaced
1216:75e5caebd392 1217:4270da0f7d3b
27 border: 0, 27 border: 0,
28 28
29 recordId: null, 29 recordId: null,
30 30
31 trackResetOnLoad: true, 31 trackResetOnLoad: true,
32
33 currentStatus: null,
32 34
33 initComponent: function() { 35 initComponent: function() {
34 var me = this; 36 var me = this;
35 var i18n = Lada.getApplication().bundle; 37 var i18n = Lada.getApplication().bundle;
36 this.items = [{ 38 this.items = [{
77 }, { 79 }, {
78 xtype: 'messmethode', 80 xtype: 'messmethode',
79 name: 'mmtId', 81 name: 'mmtId',
80 margin: '0, 10, 5, 0', 82 margin: '0, 10, 5, 0',
81 fieldLabel: 'Messmethode', 83 fieldLabel: 'Messmethode',
84 allowBlank: false,
82 width: 300, 85 width: 300,
83 labelWidth: 100 86 labelWidth: 100
84 }, { 87 }, {
85 xtype: 'datetime', 88 xtype: 'datetime',
86 name: 'messzeitpunkt', 89 name: 'messzeitpunkt',
124 margin: '0, 10, 5, 0', 127 margin: '0, 10, 5, 0',
125 fieldLabel: 'Status', 128 fieldLabel: 'Status',
126 width: 300, 129 width: 300,
127 labelWidth: 100, 130 labelWidth: 100,
128 submitValue: false, 131 submitValue: false,
129 isFormField: false,
130 preventMark: true, //Do not display error msg. 132 preventMark: true, //Do not display error msg.
131 validateValue: function() { 133 validateValue: function() {
132 return true; //this field is always valid 134 return true; //this field is always valid
133 } 135 }
134 }, { 136 }, {
166 ss.hide(); 168 ss.hide();
167 sw.hide(); 169 sw.hide();
168 } 170 }
169 }, 171 },
170 172
173 getCurrentStatus: function() {
174 return this.currentStatus;
175 },
176
171 retrieveStatus: function(messungsId, statusId) { 177 retrieveStatus: function(messungsId, statusId) {
172 var i18n = Lada.getApplication().bundle; 178 var i18n = Lada.getApplication().bundle;
173 var msg = i18n.getMsg('load.statuswert'); 179 var msg = i18n.getMsg('load.statuswert');
174 var textfield = this.down('[name=status]'); 180 var textfield = this.down('[name=status]');
175 var messwin = this.up('window'); 181 var messwin = this.up('window');
176 182
177 if(textfield) { 183 if(textfield) {
178 textfield.setRawValue(msg); 184 textfield.setRawValue(msg);
179 } 185 }
180 186
187 var me = this;
181 var sStore = Ext.create('Lada.store.Status'); 188 var sStore = Ext.create('Lada.store.Status');
182 sStore.load({ 189 sStore.load({
183 params: { 190 params: {
184 messungsId: messungsId 191 messungsId: messungsId
185 }, 192 },
188 var i18n = Lada.getApplication().bundle; 195 var i18n = Lada.getApplication().bundle;
189 if (sStore.getTotalCount() === 0 || !statusId) { 196 if (sStore.getTotalCount() === 0 || !statusId) {
190 sw = 0; 197 sw = 0;
191 } 198 }
192 else { 199 else {
193 sw = sStore.getById(statusId).get('statusWert'); 200 me.currentStatus = sStore.getById(statusId);
194 ss = sStore.getById(statusId).get('statusStufe'); 201 sk = sStore.getById(statusId).get('statusKombi');
195 se = sStore.getById(statusId).get('erzeuger'); 202 se = sStore.getById(statusId).get('mstId');
203 var kombis = Ext.data.StoreManager.get('statuskombi');
204 var rec = kombis.getById(sk);
205 sw = rec.raw.statusWert.id;
206 ss = rec.raw.statusStufe.id;
196 } 207 }
197 this.setStatusWert(sw); 208 this.setStatusWert(sw);
198 this.setStatusStufe(ss); 209 this.setStatusStufe(ss);
199 210
200 // Enable / Disable the statusreset button of the statusgrid of the messungwindow 211 // Enable / Disable the statusreset button of the statusgrid of the messungwindow
224 var textfield = this.down('[name=status]'); 235 var textfield = this.down('[name=status]');
225 236
226 if (!swStore) { 237 if (!swStore) {
227 //Set the textfield asynchronously 238 //Set the textfield asynchronously
228 swStore = Ext.create('Lada.store.StatusWerte'); 239 swStore = Ext.create('Lada.store.StatusWerte');
229 console.log('loading sw store messungform');
230 swStore.load({ 240 swStore.load({
231 scope: this, 241 scope: this,
232 callback: function(records, operation, success) { 242 callback: function(records, operation, success) {
233 if (success) { 243 if (success) {
234 var item = swStore.getById(value); 244 var item = swStore.getById(value);

http://lada.wald.intevation.org