Mercurial > lada > lada-client
comparison 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 |
comparison
equal
deleted
inserted
replaced
959:841196768e86 | 960:73b397d8dd3a |
---|---|
150 }]; | 150 }]; |
151 this.callParent(arguments); | 151 this.callParent(arguments); |
152 }, | 152 }, |
153 | 153 |
154 setRecord: function(record) { | 154 setRecord: function(record) { |
155 this.getForm().loadRecord(record); | 155 var form = this.getForm(); |
156 this.retrieveStatus(record.id, record.get('status')); | 156 form.loadRecord(record); |
157 if (record.getId()){ | |
158 this.retrieveStatus(record.id, record.get('status')); | |
159 } | |
160 else { | |
161 //remove the StatusWert and StatusStufe field from the form | |
162 var sw = this.down('[name=status]'); | |
163 var ss = this.down('[name=stufe]'); | |
164 ss.hide(); | |
165 sw.hide(); | |
166 } | |
157 }, | 167 }, |
158 | 168 |
159 retrieveStatus: function(messungsId, statusId) { | 169 retrieveStatus: function(messungsId, statusId) { |
160 var i18n = Lada.getApplication().bundle; | 170 var i18n = Lada.getApplication().bundle; |
161 var msg = i18n.getMsg('load.statuswert'); | 171 var msg = i18n.getMsg('load.statuswert'); |