comparison app/controller/form/Ort.js @ 972:24b5684d74d7

Set letzteAenderung in a Bunch of controllers.
author Dustin Demuth <dustin@intevation.de>
date Tue, 17 Nov 2015 14:58:17 +0100
parents 6e28ebbe1a73
children
comparison
equal deleted inserted replaced
971:37f30b01788c 972:24b5684d74d7
31 } 31 }
32 }); 32 });
33 }, 33 },
34 34
35 /** 35 /**
36 * The save function saves the content of the Location form. 36 * The save function saves the content of the Ort form.
37 * On success it will reload the Store, 37 * On success it will reload the Store,
38 * on failure, it will display an Errormessage 38 * on failure, it will display an Errormessage
39 */ 39 */
40 save: function(button) { 40 save: function(button) {
41 var formPanel = button.up('ortform'); 41 var formPanel = button.up('ortform');
42 var data = formPanel.getForm().getFieldValues(true); 42 var data = formPanel.getForm().getFieldValues(true);
43 for (var key in data) { 43 for (var key in data) {
44 formPanel.getForm().getRecord().set(key, data[key]); 44 formPanel.getForm().getRecord().set(key, data[key]);
45 }
46 if (!formPanel.getForm().getRecord().get('letzteAenderung')) {
47 formPanel.getForm().getRecord().data.letzteAenderung = new Date();
45 } 48 }
46 formPanel.getForm().getRecord().save({ 49 formPanel.getForm().getRecord().save({
47 success: function(record, response) { 50 success: function(record, response) {
48 var json = Ext.decode(response.response.responseText); 51 var json = Ext.decode(response.response.responseText);
49 if (json) { 52 if (json) {

http://lada.wald.intevation.org