[Lada-commits] [PATCH 1 of 7] Update probe form and button status on save
Wald Commits
scm-commit at wald.intevation.org
Fri Mar 6 17:05:13 CET 2015
# HG changeset patch
# User Raimund Renkert <raimund.renkert at intevation.de>
# Date 1425657614 -3600
# Node ID bff49c2fc3df9b9fb77718430b6306c52ddd172b
# Parent d73942e6e1c69ec42fdd395bb126cd4283fd6bc8
Update probe form and button status on save.
diff -r d73942e6e1c6 -r bff49c2fc3df app/controller/ProbeForm.js
--- a/app/controller/ProbeForm.js Fri Mar 06 13:25:15 2015 +0100
+++ b/app/controller/ProbeForm.js Fri Mar 06 17:00:14 2015 +0100
@@ -35,12 +35,19 @@
if (response.action !== 'create' &&
json &&
json.success) {
+ button.setDisabled(true);
+ button.up('toolbar').down('button[action=discard]')
+ .setDisabled(true);
+ formPanel.clearMessages();
formPanel.setRecord(record);
formPanel.setMessages(json.errors, json.warnings);
}
},
failure: function(record, response) {
- console.log('failed...');
+ button.setDisabled(true);
+ button.up('toolbar').down('button[action=discard]')
+ .setDisabled(true);
+ formPanel.getForm().loadRecord(formPanel.getForm().getRecord());
var json = response.request.scope.reader.jsonData;
if (json) {
formPanel.setMessages(json.errors, json.warnings);
More information about the Lada-commits
mailing list