diff app/controller/Orte.js @ 149:26ac4c99f8c4

Added Orte.
author Torsten Irländer <torsten.irlaender@intevation.de>
date Mon, 01 Jul 2013 17:05:03 +0200
parents 2308094f5a8c
children 16ba7e2465fd
line wrap: on
line diff
--- a/app/controller/Orte.js	Mon Jul 01 14:20:08 2013 +0200
+++ b/app/controller/Orte.js	Mon Jul 01 17:05:03 2013 +0200
@@ -5,6 +5,10 @@
         'orte.Create'
     ],
     stores: [
+        'Orte',
+        'Ortedetails',
+        'Staaten',
+        'Verwaltungseinheiten'
     ],
     models: [
         'Ort'
@@ -23,6 +27,9 @@
             'ortelist toolbar button[action=delete]': {
                 click: this.deleteOrt
             },
+            'ortecreate button[action=save]': {
+                click: this.saveOrt
+            },
             'ortecreate form': {
                 savesuccess: this.createSuccess,
                 savefailure: this.createFailure
@@ -33,9 +40,16 @@
             }
         });
     },
+    saveOrt: function(button) {
+        console.log('Saving Ort');
+        var form = button.up('window').down('form');
+        form.commit();
+    },
     addOrt: function(button) {
-        console.log('Adding new Ort');
-        var view = Ext.widget('ortecreate');
+        console.log('Adding new Ort for Probe ' + button.probeId);
+        var ort = Ext.create('Lada.model.Ort');
+        ort.set('probeId', button.probeId);
+        var view = Ext.widget('ortecreate', {model: ort});
     },
     editOrt: function(grid, record) {
         console.log('Editing Ort');

http://lada.wald.intevation.org