comparison app/controller/grid/Status.js @ 970:f4eb53ba63fc

Setting Timestamps the correct way. Before this commit the times of the instatiation of the model were used as default values, which led to wrong dates.
author Dustin Demuth <dustin@intevation.de>
date Mon, 16 Nov 2015 11:48:15 +0100
parents d4603049cd42
children ea477f62a667
comparison
equal deleted inserted replaced
969:d4603049cd42 970:f4eb53ba63fc
77 */ 77 */
78 add: function(button) { 78 add: function(button) {
79 var record = Ext.create('Lada.model.Status', { 79 var record = Ext.create('Lada.model.Status', {
80 messungsId: button.up('statusgrid').recordId 80 messungsId: button.up('statusgrid').recordId
81 }); 81 });
82 //Set the Date
83 record.data.datum = new Date();
82 var lastrow = button.up('statusgrid').store.count() 84 var lastrow = button.up('statusgrid').store.count()
83 button.up('statusgrid').store.insert(lastrow, record); 85 button.up('statusgrid').store.insert(lastrow, record);
84 button.up('statusgrid').rowEditing.startEdit(lastrow, 1); 86 button.up('statusgrid').rowEditing.startEdit(lastrow, 1);
85 }, 87 },
86 88

http://lada.wald.intevation.org