[Lada-commits] [PATCH]

Wald Commits scm-commit at wald.intevation.org
Wed Jul 24 19:15:17 CEST 2013


# HG changeset patch
# User Torsten Irländer <torsten.irlaender at intevation.de>
# Date 1374686042 -7200
# Node ID 82118c01bc5212acac5ae57ec86728d39ac0061c
# Parent  c2effc4a497b653527edd56e1e215aab04fac2f3
#57: Open Edit-Dialog after creating a new Probe.

diff -r c2effc4a497b -r 82118c01bc52 app/controller/Proben.js
--- a/app/controller/Proben.js	Wed Jul 24 15:26:39 2013 +0200
+++ b/app/controller/Proben.js	Wed Jul 24 19:14:02 2013 +0200
@@ -74,14 +74,21 @@
         });
         console.log("Loaded Probe with ID " + record.getId()); //outputs ID
     },
-    createSuccess: function(form, record, operation) {
+    createSuccess: function(form, record, response) {
         // Reload store
-        var store = this.getProbenStore();
-        store.reload();
+        //var store = this.getProbenStore();
+        //store.reload();
         var win = form.up('window');
         win.close();
+        // Open Editdialog
+        var json = Ext.decode(response.responseText);
+        if (json) {
+            var probeId = json.data.probeId;
+            record.set('probeId', probeId);
+        }
+        this.editProbe(null, record);
     },
-    createFailure: function(form, record, operation) {
+    createFailure: function(form, record, response) {
         Ext.MessageBox.show({
             title: 'Fehler beim Speichern',
             msg: form.message,
@@ -89,14 +96,14 @@
             buttons: Ext.Msg.OK
         });
     },
-    editSuccess: function(form, record, operation) {
+    editSuccess: function(form, record, response) {
         // Reload store
         var store = this.getProbenStore();
         store.reload();
         var win = form.up('window');
         win.close();
     },
-    editFailure: function(form, record, operation) {
+    editFailure: function(form, record, response) {
         Ext.MessageBox.show({
             title: 'Fehler beim Speichern',
             msg: form.message,
diff -r c2effc4a497b -r 82118c01bc52 app/view/widgets/LadaForm.js
--- a/app/view/widgets/LadaForm.js	Wed Jul 24 15:26:39 2013 +0200
+++ b/app/view/widgets/LadaForm.js	Wed Jul 24 19:14:02 2013 +0200
@@ -87,11 +87,11 @@
                     this.parseResponse(response);
                     if (this.success) {
                         console.log('Save was successfull');
-                        this.fireEvent('savesuccess', this);
+                        this.fireEvent('savesuccess', this, this.model, response);
                     } else {
                         console.log('Save was not successfull');
                         this.form.markInvalid(this.errors);
-                        this.fireEvent('savefailure', this);
+                        this.fireEvent('savefailure', this, this.model, response);
                     }
                 },
                 scope: this


More information about the Lada-commits mailing list