comparison app/view/grid/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 a73726bba79c
children
comparison
equal deleted inserted replaced
1184:be720d0473f6 1185:90ae675a1224
73 maxValue: Ext.Date.format(new Date(), 'd.m.Y H:i') 73 maxValue: Ext.Date.format(new Date(), 'd.m.Y H:i')
74 } 74 }
75 }, { 75 }, {
76 header: 'Status', 76 header: 'Status',
77 flex: 1, 77 flex: 1,
78 dataIndex: 'statusWert', 78 dataIndex: 'statusKombi',
79 renderer: function(value, meta, record, rNdx, cNdx) { 79 renderer: function(value, meta, record, rNdx, cNdx) {
80 var statusId = record.get('status'); 80 var statusId = record.get('status');
81 var mId = record.get('id'); 81 var mId = record.get('id');
82 //also fwd the record to the asynchronous loading of statuswerte 82 //also fwd the record to the asynchronous loading of statuswerte
83 // in order to add the statuswert to the record, 83 // in order to add the statuswert to the record,
84 // after the grid was rendered... 84 // after the grid was rendered...
85 if (value === '') { 85 if (!value || value === '') {
86 this.updateStatus(mId, statusId, record); 86 this.updateStatus(mId, statusId, record);
87 return 'Lade...'; 87 return 'Lade...';
88 } 88 }
89 var sta = Ext.data.StoreManager.getByKey('statuswerte'); 89 var kombis = Ext.data.StoreManager.get('statuskombi');
90 return sta.getById(value).get('wert'); 90 var kombi = kombis.getById(value);
91 var st = kombi.raw.statusWert.wert
92 return st;
91 } 93 }
92 }, { 94 }, {
93 header: 'Stufe', 95 header: 'Stufe',
94 flex: 1, 96 flex: 1,
95 dataIndex: 'statusStufe', 97 dataIndex: 'statusKombi',
96 renderer: function(value, meta, record, rNdx, cNdx) { 98 renderer: function(value, meta, record, rNdx, cNdx) {
97 var statusId = record.get('status'); 99 var statusId = record.get('status');
98 var mId = record.get('id'); 100 var mId = record.get('id');
99 //also fwd the record to the asynchronous loading of statuswerte 101 //also fwd the record to the asynchronous loading of statuswerte
100 // in order to add the statuswert to the record, 102 // in order to add the statuswert to the record,
101 // after the grid was rendered... 103 // after the grid was rendered...
102 if (value === '') { 104 if (!value || value === '') {
103 this.updateStatus(mId, statusId, record); 105 this.updateStatus(mId, statusId, record);
104 return 'Lade...'; 106 return 'Lade...';
105 } 107 }
106 var sta = Ext.data.StoreManager.getByKey('statusstufe'); 108 var kombis = Ext.data.StoreManager.get('statuskombi');
107 return sta.getById(value).get('stufe'); 109 var kombi = kombis.getById(value);
110 var st = kombi.raw.statusStufe.stufe
111 return st;
108 } 112 }
109 }, { 113 }, {
110 header: 'OK-Flag', 114 header: 'OK-Flag',
111 dataIndex: 'fertig', 115 dataIndex: 'fertig',
112 flex: 1, 116 flex: 1,
250 value = 0; 254 value = 0;
251 } 255 }
252 else { 256 else {
253 var rec = sstore.getById(opts.statusId); 257 var rec = sstore.getById(opts.statusId);
254 if (rec) { 258 if (rec) {
255 value = rec.get('statusWert'); 259 value = rec.get('statusKombi');
256 var stufe = rec.get('statusStufe');
257 //add the determined statuswert to the record. 260 //add the determined statuswert to the record.
258 // this is necessary to let the controller determine 261 // this is necessary to let the controller determine
259 // which actions are allowed. 262 // which actions are allowed.
260 opts.record.beginEdit(); 263 opts.record.beginEdit();
261 opts.record.set('statusWert', value); 264 opts.record.set('statusKombi', value);
262 opts.record.set('statusStufe', stufe);
263 opts.record.endEdit(); 265 opts.record.endEdit();
264 } 266 }
265 } 267 }
266 }, 268 },
267 269

http://lada.wald.intevation.org