# HG changeset patch # User Dustin Demuth # 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) {