Mercurial > lada > lada-client
comparison app/view/grid/Messungen.js @ 565:83c0f476d825
Felder erweitert. Alles was auf weiter Stores zugreift funktioniert noch nicht
author | Dustin Demuth <dustin@intevation.de> |
---|---|
date | Mon, 09 Mar 2015 17:12:27 +0100 |
parents | ea2c35cd9c19 |
children | 8ebe4cfca4b8 |
comparison
equal
deleted
inserted
replaced
564:7a163f7ad5d8 | 565:83c0f476d825 |
---|---|
124 maxValue: Ext.Date.format(new Date(), 'd.m.Y') | 124 maxValue: Ext.Date.format(new Date(), 'd.m.Y') |
125 } | 125 } |
126 }*/ | 126 }*/ |
127 , { | 127 , { |
128 header: 'Status', | 128 header: 'Status', |
129 dataIndex: 'id', | 129 flex: 1, |
130 flex: 1, | 130 dataIndex: 'id', |
131 renderer: function(value) { | 131 renderer: function(value) { |
132 var sstore = Ext.getStore('Status'); // Es existiert derzeit kein StatusModel. Der Status Store referenziert jedoch darauf. | 132 //fixme: dezeit existiert nur 1 status daher immer unbekannt |
133 sstore.load({ | 133 this.statusStore.load( |
134 { | |
134 params: { | 135 params: { |
135 probeId: value.recordId, | 136 messungsId: value, |
136 messungsId: value.id | |
137 } | 137 } |
138 }); | 138 }); |
139 if (sstore.getTotalCount() === 0) { | 139 |
140 return 'unbekannt'; | 140 if (!this.statusStore){ |
141 } | 141 return 'unbekannt'; |
142 return sstore.last().get('status'); | 142 } |
143 if (this.statusStore.getTotalCount() === 0) { | |
144 return 'unbekannt'; | |
145 } | |
146 return this.statusStore.last().get('status'); | |
143 } | 147 } |
144 }, { | 148 }, { |
145 header: 'OK-Flag', | 149 header: 'OK-Flag', |
146 dataIndex: 'fertig', | 150 dataIndex: 'fertig', |
147 flex: 1, | 151 flex: 1, |
155 xtype: 'checkboxfield', | 159 xtype: 'checkboxfield', |
156 allowBlank: false | 160 allowBlank: false |
157 } | 161 } |
158 }, { | 162 }, { |
159 header: 'Anzahl Nuklide', | 163 header: 'Anzahl Nuklide', |
160 flex: 1, | 164 // Gibt die Anzahl der Messwerte wieder, |
165 // NICHT die Anzahl der verschiedenen Nukleide | |
166 // Eventuell ist die Bezeichnug daher irreführend | |
167 flex: 1, | |
168 dataIndex: 'id', | |
161 renderer: function(value) { | 169 renderer: function(value) { |
162 var mstore = Ext.getStore('Messwerte'); | 170 //fixme: gibt immer 0 aus |
163 mstore.load({ | 171 this.messwerteStore.load({ |
164 params: { | 172 params: { |
165 probeId: value.recordId, | 173 messungId: value, |
166 messungsId: value.id | |
167 } | 174 } |
168 }); | 175 }); |
169 return mstore.getTotalCount(); | 176 |
177 if (!this.messwerteStore){ | |
178 return 'unbekannt'; | |
179 } | |
180 return this.messwerteStore.getCount(); | |
170 } | 181 } |
171 }, { | 182 }, { |
172 header: 'Anzahl Kommentare', | 183 header: 'Anzahl Kommentare', |
173 flex: 1, | 184 flex: 1, |
185 dataIndex: 'id', | |
174 renderer: function(value) { | 186 renderer: function(value) { |
175 var kstore = Ext.getStore('MKommentare'); | 187 //fixme: gibt immer 0 aus |
176 kstore.load({ | 188 this.mKommentareStore.load({ |
177 params: { | 189 params: { |
178 probeId: value.probeId, | 190 messungsId: value, |
179 messungsId: value.id | |
180 } | 191 } |
181 }); | 192 }); |
182 return kstore.getTotalCount(); | 193 |
194 if (!this.mKommentareStore){ | |
195 return 'unbekannt'; | |
196 } | |
197 | |
198 return this.mKommentareStore.getTotalCount(); | |
183 } | 199 } |
184 }]; | 200 }]; |
185 this.initData(); | 201 this.initData(); |
186 this.callParent(arguments); | 202 this.callParent(arguments); |
187 }, | 203 }, |
188 | 204 |
189 initData: function(){ | 205 initData: function(){ |
190 this.store = Ext.create('Lada.store.Messungen'); | 206 this.store = Ext.create('Lada.store.Messungen'); |
207 this.statusStore = Ext.create('Lada.store.Status'); | |
208 this.messwerteStore = Ext.create('Lada.store.Messwerte'); | |
209 this.mKommentareStore = Ext.create('Lada.store.MKommentare'); | |
210 | |
191 this.store.load({ | 211 this.store.load({ |
192 params: { | 212 params: { |
193 probeId: this.recordId | 213 probeId: this.recordId |
194 } | 214 } |
195 }); | 215 }); |
216 | |
217 /* | |
218 this.statusStore.load({ | |
219 params: { | |
220 messungId: this.recordId | |
221 } | |
222 }); | |
223 this.messwerteStore.load({ | |
224 params: { | |
225 messungId: this.recordId | |
226 } | |
227 }); | |
228 this.mKommentareStore.load({ | |
229 params: { | |
230 messungsId: this.recordId | |
231 } | |
232 }); | |
233 */ | |
234 | |
196 }, | 235 }, |
197 listeners: { | 236 listeners: { |
198 selectionchange: function(model, selected, eOpts) { | 237 selectionchange: function(model, selected, eOpts) { |
199 /* | 238 /* |
200 * Enable the 'details' button only when an item is selected | 239 * Enable the 'details' button only when an item is selected |