changeset 1073:e79403c3482e

Add value for letzteAenderung and reload store on change.
author Raimund Renkert <raimund.renkert@intevation.de>
date Thu, 07 Apr 2016 12:29:10 +0200
parents 78ef9b52510e
children ca204e91012f
files app/controller/grid/Probenehmer.js
diffstat 1 files changed, 5 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- 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);
     },

http://lada.wald.intevation.org