diff app/view/form/Messung.js @ 960:73b397d8dd3a

Hide Status Fields when creating a new messung
author Dustin Demuth <dustin@intevation.de>
date Tue, 10 Nov 2015 12:16:19 +0100
parents 5d57c6c53e20
children 6f1cc3316e2d
line wrap: on
line diff
--- 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) {

http://lada.wald.intevation.org