# HG changeset patch # User Raimund Renkert # Date 1464180761 -7200 # Node ID f1d21e6a74496aa474c5f41d205d9ab1914f1fb6 # Parent df6d1a2cdd4ae0bcb94394d2b9e1e5e48cda3793 Fixed adding new ortszuortnung for probe objects. diff -r df6d1a2cdd4a -r f1d21e6a7449 app/controller/form/Ortszuordnung.js --- a/app/controller/form/Ortszuordnung.js Wed May 25 14:36:51 2016 +0200 +++ b/app/controller/form/Ortszuordnung.js Wed May 25 14:52:41 2016 +0200 @@ -66,7 +66,7 @@ formPanel.clearMessages(); formPanel.setRecord(record); formPanel.setMessages(json.errors, json.warnings); - formPanel.up('window').grid.store.reload(); + formPanel.up('window').parentWindow.initData(); } //try to refresh the Grid of the Probe try { diff -r df6d1a2cdd4a -r f1d21e6a7449 app/view/form/Ortszuordnung.js --- a/app/view/form/Ortszuordnung.js Wed May 25 14:36:51 2016 +0200 +++ b/app/view/form/Ortszuordnung.js Wed May 25 14:52:41 2016 +0200 @@ -146,6 +146,9 @@ refreshOrt: function(ortId) { var orteStore = Ext.StoreManager.get('orte'); var ort = orteStore.getById(ortId); + if (!ort) { + return; + } var verwStore = Ext.StoreManager.get('verwaltungseinheiten'); var verw = verwStore.getById(ort.get('gemId')); var staatStore = Ext.StoreManager.get('staaten'); diff -r df6d1a2cdd4a -r f1d21e6a7449 app/view/window/Ortszuordnung.js --- a/app/view/window/Ortszuordnung.js Wed May 25 14:36:51 2016 +0200 +++ b/app/view/window/Ortszuordnung.js Wed May 25 14:52:41 2016 +0200 @@ -99,6 +99,13 @@ * Initialise the Data of this Window */ initData: function() { + if (!this.record) { + this.record = Ext.create('Lada.model.Ortszuordnung'); + if (!this.record.get('letzteAenderung')) { + this.record.data.letzteAenderung = new Date(); + } + this.record.set('probeId', this.probe.get('id')); + } this.down('ortszuordnungform').setRecord(this.record); this.down('ortpanel').setStore(); },