comparison 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
comparison
equal deleted inserted replaced
1072:78ef9b52510e 1073:e79403c3482e
47 */ 47 */
48 gridSave: function(editor, context) { 48 gridSave: function(editor, context) {
49 var i18n = Lada.getApplication().bundle; 49 var i18n = Lada.getApplication().bundle;
50 context.record.save({ 50 context.record.save({
51 success: function(record, response) { 51 success: function(record, response) {
52 //Do Nothing 52 var grid = Ext.ComponentQuery.query('probenehmergrid')[0];
53 grid.store.reload();
53 }, 54 },
54 failure: function(record, response) { 55 failure: function(record, response) {
55 var json = response.request.scope.reader.jsonData; 56 var json = response.request.scope.reader.jsonData;
56 if (json) { 57 if (json) {
57 if (json.message){ 58 if (json.message){
85 /** 86 /**
86 * This function adds a new row to add a probenehmer 87 * This function adds a new row to add a probenehmer
87 */ 88 */
88 add: function(button) { 89 add: function(button) {
89 var record = Ext.create('Lada.model.Probenehmer'); 90 var record = Ext.create('Lada.model.Probenehmer');
91 if (!record.get('letzteAenderung')) {
92 record.data.letzteAenderung = new Date();
93 }
90 button.up('probenehmergrid').store.insert(0, record); 94 button.up('probenehmergrid').store.insert(0, record);
91 button.up('probenehmergrid').rowEditing.startEdit(0, 1); 95 button.up('probenehmergrid').rowEditing.startEdit(0, 1);
92 }, 96 },
93 97
94 /** 98 /**

http://lada.wald.intevation.org