changeset 1072:78ef9b52510e

Load messprogrammkategorie controller and handle requests correct.
author Raimund Renkert <raimund.renkert@intevation.de>
date Thu, 07 Apr 2016 12:28:17 +0200
parents 116b9629eb2c
children e79403c3482e
files app.js app/controller/grid/MessprogrammKategorie.js
diffstat 2 files changed, 9 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/app.js	Thu Apr 07 10:42:08 2016 +0200
+++ b/app.js	Thu Apr 07 12:28:17 2016 +0200
@@ -271,6 +271,7 @@
         'Lada.controller.form.Ortszuordnung',
         'Lada.controller.form.Location',
         'Lada.controller.form.Messprogramm',
+        'Lada.controller.grid.MessprogrammKategorie',
         'Lada.controller.grid.Messmethode',
         'Lada.controller.FilterManagement'
         ]
--- a/app/controller/grid/MessprogrammKategorie.js	Thu Apr 07 10:42:08 2016 +0200
+++ b/app/controller/grid/MessprogrammKategorie.js	Thu Apr 07 12:28:17 2016 +0200
@@ -25,7 +25,7 @@
                 deselect: this.buttonToggle,
                 itemdblclick: this.edit
             },
-            'messprogrammkategoriegrid button[action=add]': {
+            'messprogrammkategoriegrid toolbar button[action=add]': {
                 click: this.add
             },
             'messprogrammkategoriegrid button[action=delete]': {
@@ -49,7 +49,8 @@
         var i18n = Lada.getApplication().bundle;
         context.record.save({
             success: function(record, response) {
-                //Do Nothing
+                var grid = Ext.ComponentQuery.query('messprogrammkategoriegrid')[0];
+                grid.store.reload();
             },
             failure: function(record, response) {
               var json = response.request.scope.reader.jsonData;
@@ -84,6 +85,9 @@
      */
     add: function(button) {
         var record = Ext.create('Lada.model.MessprogrammKategorie');
+        if (!record.get('letzteAenderung')) {
+            record.data.letzteAenderung = new Date();
+        }
         button.up('messprogrammkategoriegrid').store.insert(0, record);
         button.up('messprogrammkategoriegrid').rowEditing.startEdit(0, 1);
     },
@@ -104,7 +108,8 @@
             if (btn === 'yes') {
                 selection.destroy({
                     success: function() {
-                        //DO NOTHING
+                        var grid = Ext.ComponentQuery.query('messprogrammkategoriegrid')[0];
+                        grid.store.reload();
                     },
                     failure: function(request, response) {
                         var json = response.request.scope.reader.jsonData;

http://lada.wald.intevation.org