comparison app/view/grid/Ortszuordnung.js @ 1289:bfdc00c24baf

Ortszuordnung for messprogramm and probe using same form
author Maximilian Krambach <mkrambach@intevation.de>
date Wed, 01 Feb 2017 14:52:51 +0100
parents a792eecf1614
children 394c722e5402
comparison
equal deleted inserted replaced
1288:08085b7d1d0b 1289:bfdc00c24baf
22 deferEmptyText: false 22 deferEmptyText: false
23 }, 23 },
24 margin: '0, 5, 5, 5', 24 margin: '0, 5, 5, 5',
25 25
26 recordId: null, 26 recordId: null,
27
28 isMessprogramm: false,
27 29
28 warnings: null, 30 warnings: null,
29 errors: null, 31 errors: null,
30 readOnly: true, 32 readOnly: true,
31 allowDeselect: true, 33 allowDeselect: true,
162 this.callParent(arguments); 164 this.callParent(arguments);
163 this.setReadOnly(true); //Grid is always initialised as RO 165 this.setReadOnly(true); //Grid is always initialised as RO
164 }, 166 },
165 167
166 initData: function() { 168 initData: function() {
167 this.store = Ext.create('Lada.store.Ortszuordnung'); 169 if (this.isMessprogramm) {
168 this.store.load({ 170 //TODO
169 params: { 171 } else {
170 probeId: this.recordId 172 this.store = Ext.create('Lada.store.Ortszuordnung');
171 } 173 this.store.load({
172 }); 174 params: {
173 Ext.ClassManager.get('Lada.model.Probe').load(this.recordId, { 175 probeId: this.recordId
174 failure: function(record, action) { 176 }
175 // TODO 177 });
176 }, 178 Ext.ClassManager.get('Lada.model.Probe').load(this.recordId, {
177 success: function(record, response) { 179 failure: function(record, action) {
178 var json = Ext.decode(response.response.responseText); 180 // TODO
179 if (json) { 181 },
180 this.warnings = json.warnings; 182 success: function(record, response) {
181 this.errors = json.errors; 183 var json = Ext.decode(response.response.responseText);
182 } 184 if (json) {
183 }, 185 this.warnings = json.warnings;
184 scope: this 186 this.errors = json.errors;
185 }); 187 }
188 },
189 scope: this
190 });
191 }
186 }, 192 },
187 193
188 setReadOnly: function(b) { 194 setReadOnly: function(b) {
189 this.readOnly = b; 195 this.readOnly = b;
190 if (b) { 196 if (b) {

http://lada.wald.intevation.org