comparison app/view/grid/Ortszuordnung.js @ 1339:1a2cd9bef6d7

messprogramm zuordnung now functional
author Maximilian Krambach <mkrambach@intevation.de>
date Fri, 03 Feb 2017 19:37:28 +0100
parents 394c722e5402
children 8742d020c685
comparison
equal deleted inserted replaced
1338:d2f06ce4d43a 1339:1a2cd9bef6d7
166 this.callParent(arguments); 166 this.callParent(arguments);
167 this.setReadOnly(true); //Grid is always initialised as RO 167 this.setReadOnly(true); //Grid is always initialised as RO
168 }, 168 },
169 169
170 initData: function() { 170 initData: function() {
171 var modelname;
171 if (this.isMessprogramm) { 172 if (this.isMessprogramm) {
172 //TODO 173 this.store = Ext.create('Lada.store.OrtszuordnungMp');
174 this.store.load({
175 params: {
176 messprogrammId: this.recordId
177 }});
178 modelname = 'Lada.model.Messprogramm';
173 } else { 179 } else {
180 modelname = 'Lada.model.Probe';
174 this.store = Ext.create('Lada.store.Ortszuordnung'); 181 this.store = Ext.create('Lada.store.Ortszuordnung');
175 this.store.load({ 182 this.store.load({
176 params: { 183 params: {
177 probeId: this.recordId 184 probeId: this.recordId
178 } 185 }});
179 }); 186 }
180 Ext.ClassManager.get('Lada.model.Probe').load(this.recordId, { 187 Ext.ClassManager.get(modelname).load(this.recordId, {
181 failure: function(record, action) { 188 failure: function(record, action) {
182 // TODO 189 // TODO
183 }, 190 },
184 success: function(record, response) { 191 success: function(record, response) {
185 var json = Ext.decode(response.response.responseText); 192 var json = Ext.decode(response.response.responseText);
186 if (json) { 193 if (json) {
187 this.warnings = json.warnings; 194 this.warnings = json.warnings;
188 this.errors = json.errors; 195 this.errors = json.errors;
189 } 196 }
190 }, 197 },
191 scope: this 198 scope: this
192 }); 199 });
193 }
194 }, 200 },
195 201
196 setReadOnly: function(b) { 202 setReadOnly: function(b) {
197 this.readOnly = b; 203 this.readOnly = b;
198 if (b) { 204 if (b) {

http://lada.wald.intevation.org