comparison app/controller/grid/Datensatzerzeuger.js @ 1079:1c86a259c2ac

Set letzteAenderung for new datensatzerzeuger.
author Raimund Renkert <raimund.renkert@intevation.de>
date Wed, 13 Apr 2016 13:57:36 +0200
parents fe5fb960da9d
children 5e9a674d7bb4
comparison
equal deleted inserted replaced
1078:fe5fb960da9d 1079:1c86a259c2ac
66 */ 66 */
67 gridSave: function(editor, context) { 67 gridSave: function(editor, context) {
68 var i18n = Lada.getApplication().bundle; 68 var i18n = Lada.getApplication().bundle;
69 context.record.save({ 69 context.record.save({
70 success: function(record, response) { 70 success: function(record, response) {
71 //Do Nothing 71 var grid = Ext.ComponentQuery.query('datensatzerzeugergrid')[0];
72 grid.store.reload();
72 }, 73 },
73 failure: function(record, response) { 74 failure: function(record, response) {
74 var json = response.request.scope.reader.jsonData; 75 var json = response.request.scope.reader.jsonData;
75 if (json) { 76 if (json) {
76 if (json.message){ 77 if (json.message){
104 /** 105 /**
105 * This function adds a new row to add a Datensatzerzeuger 106 * This function adds a new row to add a Datensatzerzeuger
106 */ 107 */
107 add: function(button) { 108 add: function(button) {
108 var record = Ext.create('Lada.model.DatensatzErzeuger'); 109 var record = Ext.create('Lada.model.DatensatzErzeuger');
110 if (!record.get('letzteAenderung')) {
111 record.data.letzteAenderung = new Date();
112 }
109 button.up('datensatzerzeugergrid').store.insert(0, record); 113 button.up('datensatzerzeugergrid').store.insert(0, record);
110 button.up('datensatzerzeugergrid').rowEditing.startEdit(0, 1); 114 button.up('datensatzerzeugergrid').rowEditing.startEdit(0, 1);
111 }, 115 },
112 116
113 /** 117 /**

http://lada.wald.intevation.org