diff app/controller/grid/Probenehmer.js @ 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 fa422d69940c
children fe5fb960da9d
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