Mercurial > lada > lada-client
comparison app/view/grid/Messung.js @ 1062:0497693d5b74
Show statusStufe in messunggrid.
author | Raimund Renkert <raimund.renkert@intevation.de> |
---|---|
date | Wed, 09 Mar 2016 16:15:23 +0100 |
parents | 7d7b691713aa |
children | a73726bba79c |
comparison
equal
deleted
inserted
replaced
1061:4db4902d11c8 | 1062:0497693d5b74 |
---|---|
87 } | 87 } |
88 var sta = Ext.data.StoreManager.getByKey('statuswerte'); | 88 var sta = Ext.data.StoreManager.getByKey('statuswerte'); |
89 return sta.getById(value).get('wert'); | 89 return sta.getById(value).get('wert'); |
90 } | 90 } |
91 }, { | 91 }, { |
92 header: 'Stufe', | |
93 flex: 1, | |
94 dataIndex: 'statusStufe', | |
95 renderer: function(value, meta, record, rNdx, cNdx) { | |
96 var statusId = record.get('status'); | |
97 var mId = record.get('id'); | |
98 //also fwd the record to the asynchronous loading of statuswerte | |
99 // in order to add the statuswert to the record, | |
100 // after the grid was rendered... | |
101 if (value === '') { | |
102 this.updateStatus(mId, statusId, record); | |
103 return 'Lade...'; | |
104 } | |
105 var sta = Ext.data.StoreManager.getByKey('statusstufe'); | |
106 return sta.getById(value).get('stufe'); | |
107 } | |
108 }, { | |
92 header: 'OK-Flag', | 109 header: 'OK-Flag', |
93 dataIndex: 'fertig', | 110 dataIndex: 'fertig', |
94 flex: 1, | 111 flex: 1, |
95 renderer: function(value) { | 112 renderer: function(value) { |
96 if (value) { | 113 if (value) { |
230 } | 247 } |
231 else { | 248 else { |
232 var rec = sstore.getById(opts.statusId); | 249 var rec = sstore.getById(opts.statusId); |
233 if (rec) { | 250 if (rec) { |
234 value = rec.get('statusWert'); | 251 value = rec.get('statusWert'); |
252 var stufe = rec.get('statusStufe'); | |
235 //add the determined statuswert to the record. | 253 //add the determined statuswert to the record. |
236 // this is necessary to let the controller determine | 254 // this is necessary to let the controller determine |
237 // which actions are allowed. | 255 // which actions are allowed. |
238 opts.record.beginEdit(); | 256 opts.record.beginEdit(); |
239 opts.record.set('statusWert', value); | 257 opts.record.set('statusWert', value); |
258 opts.record.set('statusStufe', stufe); | |
240 opts.record.endEdit(); | 259 opts.record.endEdit(); |
241 } | 260 } |
242 } | 261 } |
243 }, | 262 }, |
244 | 263 |