[Lada-commits] [PATCH 2 of 3] Load messprogrammkategorie controller and handle requests correct

Wald Commits scm-commit at wald.intevation.org
Thu Apr 7 12:29:04 CEST 2016


# HG changeset patch
# User Raimund Renkert <raimund.renkert at intevation.de>
# Date 1460024897 -7200
# Node ID 78ef9b52510e22b1c8b9a21777258821ba12c9b2
# Parent  116b9629eb2cffa7090bc54e63d0b481caf059f6
Load messprogrammkategorie controller and handle requests correct.

diff -r 116b9629eb2c -r 78ef9b52510e app.js
--- 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'
         ]
diff -r 116b9629eb2c -r 78ef9b52510e app/controller/grid/MessprogrammKategorie.js
--- 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;


More information about the Lada-commits mailing list