Mercurial > lada > lada-client
diff 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 |
line wrap: on
line diff
--- a/app/view/grid/Ortszuordnung.js Fri Feb 03 18:01:25 2017 +0100 +++ b/app/view/grid/Ortszuordnung.js Fri Feb 03 19:37:28 2017 +0100 @@ -168,29 +168,35 @@ }, initData: function() { + var modelname; if (this.isMessprogramm) { - //TODO + this.store = Ext.create('Lada.store.OrtszuordnungMp'); + this.store.load({ + params: { + messprogrammId: this.recordId + }}); + modelname = 'Lada.model.Messprogramm'; } else { + modelname = 'Lada.model.Probe'; this.store = Ext.create('Lada.store.Ortszuordnung'); this.store.load({ params: { probeId: this.recordId + }}); + } + Ext.ClassManager.get(modelname).load(this.recordId, { + failure: function(record, action) { + // TODO + }, + success: function(record, response) { + var json = Ext.decode(response.response.responseText); + if (json) { + this.warnings = json.warnings; + this.errors = json.errors; } - }); - Ext.ClassManager.get('Lada.model.Probe').load(this.recordId, { - failure: function(record, action) { - // TODO - }, - success: function(record, response) { - var json = Ext.decode(response.response.responseText); - if (json) { - this.warnings = json.warnings; - this.errors = json.errors; - } - }, - scope: this - }); - } + }, + scope: this + }); }, setReadOnly: function(b) {