comparison app/controller/form/Ort.js @ 641:5b5bba1d8e6a

Load and update the correct orte form.
author Raimund Renkert <raimund.renkert@intevation.de>
date Tue, 17 Mar 2015 16:04:23 +0100
parents 3d33c65319f3
children 71e8b84d7829
comparison
equal deleted inserted replaced
640:f4969c71654a 641:5b5bba1d8e6a
25 } 25 }
26 }); 26 });
27 }, 27 },
28 28
29 save: function(button) { 29 save: function(button) {
30 var formPanel = button.up('form'); 30 var formPanel = button.up('ortform');
31 var data = formPanel.getForm().getFieldValues(true); 31 var data = formPanel.getForm().getFieldValues(true);
32 for (var key in data) { 32 for (var key in data) {
33 formPanel.getForm().getRecord().set(key, data[key]); 33 formPanel.getForm().getRecord().set(key, data[key]);
34 } 34 }
35 formPanel.getForm().getRecord().save({ 35 formPanel.getForm().getRecord().save({
36 success: function(record, response) { 36 success: function(record, response) {
37 var json = Ext.decode(response.response.responseText); 37 var json = Ext.decode(response.response.responseText);
38 if (response.action !== 'create' && 38 if (json) {
39 json &&
40 json.success) {
41 button.setDisabled(true); 39 button.setDisabled(true);
42 button.up('toolbar').down('button[action=discard]') 40 button.up('toolbar').down('button[action=discard]')
43 .setDisabled(true); 41 .setDisabled(true);
44 formPanel.clearMessages(); 42 formPanel.clearMessages();
45 formPanel.setRecord(record); 43 formPanel.setRecord(record);

http://lada.wald.intevation.org