[Lada-commits] [PATCH] Open Probe-/Messung-Edit window automatically if a new item was saved

Wald Commits scm-commit at wald.intevation.org
Tue Mar 17 14:44:04 CET 2015


# HG changeset patch
# User Raimund Renkert <raimund.renkert at intevation.de>
# Date 1426599892 -3600
# Node ID fdaabab6f4cc9d7aad4ed70a5328298386a94b27
# Parent  d21048cbdbb3259554cf683978462605cf553035
Open Probe-/Messung-Edit window automatically if a new item was saved
successfully.

diff -r d21048cbdbb3 -r fdaabab6f4cc app/controller/form/Messung.js
--- 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) {
diff -r d21048cbdbb3 -r fdaabab6f4cc app/controller/form/Probe.js
--- 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) {
diff -r d21048cbdbb3 -r fdaabab6f4cc app/view/window/ProbeEdit.js
--- 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,


More information about the Lada-commits mailing list