comparison app/controller/form/Probe.js @ 728:aadb6e1f0a70

Load the record returned by the request.
author Raimund Renkert <raimund.renkert@intevation.de>
date Fri, 17 Apr 2015 13:15:11 +0200
parents c2a6f7caa71b
children a76638970d50 6e28ebbe1a73
comparison
equal deleted inserted replaced
727:e002234d7da5 728:aadb6e1f0a70
56 button.setDisabled(true); 56 button.setDisabled(true);
57 button.up('toolbar').down('button[action=discard]') 57 button.up('toolbar').down('button[action=discard]')
58 .setDisabled(true); 58 .setDisabled(true);
59 var rec = formPanel.getForm().getRecord(); 59 var rec = formPanel.getForm().getRecord();
60 rec.dirty = false; 60 rec.dirty = false;
61 formPanel.getForm().loadRecord(rec); 61 formPanel.getForm().loadRecord(record);
62 var json = response.request.scope.reader.jsonData; 62 var json = response.request.scope.reader.jsonData;
63 if (json) { 63 if (json) {
64 if(json.errors.totalCount > 0 || json.warnings.totalCount > 0){ 64 if(json.errors.totalCount > 0 || json.warnings.totalCount > 0){
65 formPanel.setMessages(json.errors, json.warnings); 65 formPanel.setMessages(json.errors, json.warnings);
66 } 66 }
72 } else { 72 } else {
73 Ext.Msg.alert(Lada.getApplication().bundle.getMsg('err.msg.save.title'), 73 Ext.Msg.alert(Lada.getApplication().bundle.getMsg('err.msg.save.title'),
74 Lada.getApplication().bundle.getMsg('err.msg.generic.body')); 74 Lada.getApplication().bundle.getMsg('err.msg.generic.body'));
75 } 75 }
76 formPanel.clearMessages(); 76 formPanel.clearMessages();
77 formPanel.setRecord(record); 77 //formPanel.setRecord(record);
78 formPanel.setMessages(json.errors, json.warnings); 78 formPanel.setMessages(json.errors, json.warnings);
79 } else { 79 } else {
80 Ext.Msg.alert(Lada.getApplication().bundle.getMsg('err.msg.save.title'), 80 Ext.Msg.alert(Lada.getApplication().bundle.getMsg('err.msg.save.title'),
81 Lada.getApplication().bundle.getMsg('err.msg.response.body')); 81 Lada.getApplication().bundle.getMsg('err.msg.response.body'));
82 } 82 }

http://lada.wald.intevation.org