diff app/controller/Proben.js @ 70:1a943947a7d2

Added new listeners for events comming from the Probenforms.
author Torsten Irländer <torsten.irlaender@intevation.de>
date Wed, 05 Jun 2013 15:43:42 +0200
parents cb1138f5cea7
children db26aeebe521
line wrap: on
line diff
--- a/app/controller/Proben.js	Wed Jun 05 15:43:05 2013 +0200
+++ b/app/controller/Proben.js	Wed Jun 05 15:43:42 2013 +0200
@@ -27,11 +27,18 @@
             'probenlist toolbar button[action=add]': {
                 click: this.addProbe
             },
+            'probencreate form': {
+                savesuccess: this.createSuccess,
+                savefailure: this.createFailure
+            },
+            'probenedit form': {
+                savesuccess: this.editSuccess,
+                savefailure: this.editFailure
             }
         });
     },
     addProbe: function(button) {
-        console.log('Adding new Probe');
+        console.log('Adding new Probe 1');
         var view = Ext.widget('probencreate');
     },
     editProbe: function(grid, record) {
@@ -56,5 +63,25 @@
     createSuccess: function(form, record, operation) {
         var win = form.up('window');
         win.close();
+    },
+    createFailure: function(form, record, operation) {
+        Ext.MessageBox.show({
+            title: 'Fehler beim Speichern',
+            msg: 'Es gab Fehler beim Anlegen der Probe',
+            icon: Ext.MessageBox.ERROR,
+            buttons: Ext.Msg.OK
+        });
+    },
+    editSuccess: function(form, record, operation) {
+        var win = form.up('window');
+        win.close();
+    },
+    editFailure: function(form, record, operation) {
+        Ext.MessageBox.show({
+            title: 'Fehler beim Speichern',
+            msg: 'Es gab Fehler beim Speichern der Probe',
+            icon: Ext.MessageBox.ERROR,
+            buttons: Ext.Msg.OK
+        });
     }
 });

http://lada.wald.intevation.org