changeset 639:fdaabab6f4cc

Open Probe-/Messung-Edit window automatically if a new item was saved successfully.
author Raimund Renkert <raimund.renkert@intevation.de>
date Tue, 17 Mar 2015 14:44:52 +0100
parents d21048cbdbb3
children f4969c71654a
files app/controller/form/Messung.js app/controller/form/Probe.js app/view/window/ProbeEdit.js
diffstat 3 files changed, 18 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/app/controller/form/Messung.js	Tue Mar 17 14:33:13 2015 +0100
+++ b/app/controller/form/Messung.js	Tue Mar 17 14:44:52 2015 +0100
@@ -39,6 +39,14 @@
                     formPanel.clearMessages();
                     formPanel.setRecord(record);
                     formPanel.setMessages(json.errors, json.warnings);
+                    if (response.action === 'create' && json.success) {
+                        button.up('window').close();
+                        var win = Ext.create('Lada.view.window.MessungEdit', {
+                            record: record
+                        });
+                        win.show();
+                        win.initData();
+                    }
                 }
             },
             failure: function(record, response) {
--- a/app/controller/form/Probe.js	Tue Mar 17 14:33:13 2015 +0100
+++ b/app/controller/form/Probe.js	Tue Mar 17 14:44:52 2015 +0100
@@ -39,6 +39,14 @@
                     formPanel.clearMessages();
                     formPanel.setRecord(record);
                     formPanel.setMessages(json.errors, json.warnings);
+                    if (response.action === 'create' && json.success) {
+                        button.up('window').close();
+                        var win = Ext.create('Lada.view.window.ProbeEdit', {
+                            record: record
+                        });
+                        win.show();
+                        win.initData();
+                    }
                 }
             },
             failure: function(record, response) {
--- a/app/view/window/ProbeEdit.js	Tue Mar 17 14:33:13 2015 +0100
+++ b/app/view/window/ProbeEdit.js	Tue Mar 17 14:44:52 2015 +0100
@@ -35,7 +35,8 @@
             this.callParent(arguments);
             return;
         }
-        this.title = '§3-Probe ' + this.record.get('probeId');
+        var extendedTitle = this.record.get('probeId') ? this.record.get('probeId') : '';
+        this.title = '§3-Probe ' + extendedTitle;
         this.buttons = [{
             text: 'Schließen',
             scope: this,

http://lada.wald.intevation.org