Mercurial > lada > lada-client
comparison app/view/form/Messung.js @ 1185:90ae675a1224 schema-update
Updated client status workflow and model.
author | Raimund Renkert <raimund.renkert@intevation.de> |
---|---|
date | Wed, 31 Aug 2016 15:58:49 +0200 |
parents | bb44ec8746f5 |
children | 793748ded4d4 |
comparison
equal
deleted
inserted
replaced
1184:be720d0473f6 | 1185:90ae675a1224 |
---|---|
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 |