diff app/controller/grid/Datensatzerzeuger.js @ 1079:1c86a259c2ac

Set letzteAenderung for new datensatzerzeuger.
author Raimund Renkert <raimund.renkert@intevation.de>
date Wed, 13 Apr 2016 13:57:36 +0200
parents fe5fb960da9d
children 5e9a674d7bb4
line wrap: on
line diff
--- a/app/controller/grid/Datensatzerzeuger.js	Wed Apr 13 13:55:39 2016 +0200
+++ b/app/controller/grid/Datensatzerzeuger.js	Wed Apr 13 13:57:36 2016 +0200
@@ -68,7 +68,8 @@
         var i18n = Lada.getApplication().bundle;
         context.record.save({
             success: function(record, response) {
-                //Do Nothing
+                var grid = Ext.ComponentQuery.query('datensatzerzeugergrid')[0];
+                grid.store.reload();
             },
             failure: function(record, response) {
               var json = response.request.scope.reader.jsonData;
@@ -106,6 +107,9 @@
      */
     add: function(button) {
         var record = Ext.create('Lada.model.DatensatzErzeuger');
+        if (!record.get('letzteAenderung')) {
+            record.data.letzteAenderung = new Date();
+        }
         button.up('datensatzerzeugergrid').store.insert(0, record);
         button.up('datensatzerzeugergrid').rowEditing.startEdit(0, 1);
     },

http://lada.wald.intevation.org