[Lada-commits] [PATCH 2 of 4] Set letzteAenderung for new datensatzerzeuger

Wald Commits scm-commit at wald.intevation.org
Wed Apr 13 18:41:59 CEST 2016


# HG changeset patch
# User Raimund Renkert <raimund.renkert at intevation.de>
# Date 1460548656 -7200
# Node ID 1c86a259c2acffe180c9dd76e5c47cb98eff7b63
# Parent  fe5fb960da9d013693fac388d3ea9b6de6c8d27b
Set letzteAenderung for new datensatzerzeuger.

diff -r fe5fb960da9d -r 1c86a259c2ac app/controller/grid/Datensatzerzeuger.js
--- 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);
     },


More information about the Lada-commits mailing list