[Lada-commits] [PATCH 3 of 3] Add value for letzteAenderung and reload store on change

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


# HG changeset patch
# User Raimund Renkert <raimund.renkert at intevation.de>
# Date 1460024950 -7200
# Node ID e79403c3482eff602337e12d791b57971a009315
# Parent  78ef9b52510e22b1c8b9a21777258821ba12c9b2
Add value for letzteAenderung and reload store on change.

diff -r 78ef9b52510e -r e79403c3482e app/controller/grid/Probenehmer.js
--- a/app/controller/grid/Probenehmer.js	Thu Apr 07 12:28:17 2016 +0200
+++ b/app/controller/grid/Probenehmer.js	Thu Apr 07 12:29:10 2016 +0200
@@ -49,7 +49,8 @@
         var i18n = Lada.getApplication().bundle;
         context.record.save({
             success: function(record, response) {
-                //Do Nothing
+                var grid = Ext.ComponentQuery.query('probenehmergrid')[0];
+                grid.store.reload();
             },
             failure: function(record, response) {
               var json = response.request.scope.reader.jsonData;
@@ -87,6 +88,9 @@
      */
     add: function(button) {
         var record = Ext.create('Lada.model.Probenehmer');
+        if (!record.get('letzteAenderung')) {
+            record.data.letzteAenderung = new Date();
+        }
         button.up('probenehmergrid').store.insert(0, record);
         button.up('probenehmergrid').rowEditing.startEdit(0, 1);
     },


More information about the Lada-commits mailing list