Mercurial > lada > lada-client
comparison app/view/form/Ortszuordnung.js @ 1339:1a2cd9bef6d7
messprogramm zuordnung now functional
author | Maximilian Krambach <mkrambach@intevation.de> |
---|---|
date | Fri, 03 Feb 2017 19:37:28 +0100 |
parents | d2f06ce4d43a |
children | 15e4a3e42ad7 |
comparison
equal
deleted
inserted
replaced
1338:d2f06ce4d43a | 1339:1a2cd9bef6d7 |
---|---|
36 trackResetOnLoad: true, | 36 trackResetOnLoad: true, |
37 | 37 |
38 initComponent: function() { | 38 initComponent: function() { |
39 var i18n = Lada.getApplication().bundle; | 39 var i18n = Lada.getApplication().bundle; |
40 var me = this; | 40 var me = this; |
41 if (this.type == 'probe') { | |
42 this.ortIdName = 'ortId'; | |
43 this.typName = 'ortszuordnungTyp'; | |
44 } else if (this.type == 'mpr') { | |
45 this.ortIdName = 'ort'; | |
46 this.typName = 'ortsTyp'; | |
47 } | |
48 this.items = [{ | 41 this.items = [{ |
49 xtype: 'fieldset', | 42 xtype: 'fieldset', |
50 title: i18n.getMsg('ortszuordnung.form.fset.title'), | 43 title: i18n.getMsg('ortszuordnung.form.fset.title'), |
51 layout: 'fit', | 44 layout: 'fit', |
52 items: [{ | 45 items: [{ |
102 }, { | 95 }, { |
103 xtype: 'ortszuordnungtyp', | 96 xtype: 'ortszuordnungtyp', |
104 labelWidth: 125, | 97 labelWidth: 125, |
105 allowBlank: false, | 98 allowBlank: false, |
106 editable: true, | 99 editable: true, |
107 name: this.typName, | 100 name: 'ortszuordnungTyp', |
108 disableKeyFilter: true, | 101 disableKeyFilter: true, |
109 fieldLabel: i18n.getMsg('ortszuordnung.form.field.ortszuordnungtyp'), | 102 fieldLabel: i18n.getMsg('ortszuordnung.form.field.ortszuordnungtyp'), |
110 }, { | 103 }, { |
111 // this field is hidden because the user doesn't | 104 // this field is hidden because the user doesn't |
112 // need to know the internal ortID | 105 // need to know the internal ortID |
113 xtype: 'textfield', | 106 xtype: 'textfield', |
114 allowBlank: false, | 107 allowBlank: false, |
115 regex: /^[0-9]{1,45}$/, | 108 regex: /^[0-9]{1,45}$/, |
116 submitValue: true, | 109 submitValue: true, |
117 hidden: true, | 110 hidden: true, |
118 name: this.ortIdName, | 111 name: 'ortId', |
119 listeners: { | 112 listeners: { |
120 change: me.changed | 113 change: me.changed |
121 } | 114 } |
122 }] | 115 }] |
123 }, | 116 }, |
214 this.down('tfield[name=ortszusatztext]').clearWarningOrError(); | 207 this.down('tfield[name=ortszusatztext]').clearWarningOrError(); |
215 }, | 208 }, |
216 | 209 |
217 setReadOnly: function(value) { | 210 setReadOnly: function(value) { |
218 this.down('tfield[name=ortszusatztext]').setReadOnly(value); | 211 this.down('tfield[name=ortszusatztext]').setReadOnly(value); |
219 var fieldId = 'textfield[name=' + this.typName +']'; | 212 var fieldId = 'textfield[name=ortszuordnungTyp]'; |
220 this.down(fieldId).setReadOnly(value); | 213 this.down(fieldId).setReadOnly(value); |
221 }, | 214 }, |
222 | 215 |
223 /** | 216 /** |
224 * Helper to trigger the forms' validity check | 217 * Helper to trigger the forms' validity check |