[Lada-commits] [PATCH 4 of 5] Hide Status Fields when creating a new messung
Wald Commits
scm-commit at wald.intevation.org
Tue Nov 10 13:09:35 CET 2015
# HG changeset patch
# User Dustin Demuth <dustin at intevation.de>
# Date 1447154179 -3600
# Node ID 73b397d8dd3aba1bb1b739582a7c57a6d279663d
# Parent 841196768e8631fc95a9452cc42407791cee0448
Hide Status Fields when creating a new messung
diff -r 841196768e86 -r 73b397d8dd3a app/view/form/Messung.js
--- a/app/view/form/Messung.js Tue Nov 10 10:53:06 2015 +0100
+++ b/app/view/form/Messung.js Tue Nov 10 12:16:19 2015 +0100
@@ -152,8 +152,18 @@
},
setRecord: function(record) {
- this.getForm().loadRecord(record);
- this.retrieveStatus(record.id, record.get('status'));
+ var form = this.getForm();
+ form.loadRecord(record);
+ if (record.getId()){
+ this.retrieveStatus(record.id, record.get('status'));
+ }
+ else {
+ //remove the StatusWert and StatusStufe field from the form
+ var sw = this.down('[name=status]');
+ var ss = this.down('[name=stufe]');
+ ss.hide();
+ sw.hide();
+ }
},
retrieveStatus: function(messungsId, statusId) {
More information about the Lada-commits
mailing list