Mercurial > lada > lada-client
comparison app/view/proben/Create.js @ 68:e54cb2f3566e
Do not define form element in the window. Use new defined Probencreate Form.
author | Torsten Irländer <torsten.irlaender@intevation.de> |
---|---|
date | Wed, 05 Jun 2013 15:41:44 +0200 |
parents | 9e2e09e819fd |
children | 95b08b96f5c9 |
comparison
equal
deleted
inserted
replaced
67:7ea76e760fc2 | 68:e54cb2f3566e |
---|---|
10 autoShow: true, | 10 autoShow: true, |
11 autoScroll: true, | 11 autoScroll: true, |
12 modal: true, | 12 modal: true, |
13 | 13 |
14 requires: [ | 14 requires: [ |
15 'Lada.view.proben.CreateForm', | |
15 'Lada.view.widgets.Uwb', | 16 'Lada.view.widgets.Uwb', |
16 'Lada.view.widgets.Datenbasis', | 17 'Lada.view.widgets.Datenbasis', |
17 'Lada.view.widgets.Probenart', | 18 'Lada.view.widgets.Probenart', |
18 'Lada.view.widgets.Betriebsart', | 19 'Lada.view.widgets.Betriebsart', |
19 'Lada.view.widgets.Testdatensatz' | 20 'Lada.view.widgets.Testdatensatz' |
20 ], | 21 ], |
21 | |
22 initComponent: function() { | 22 initComponent: function() { |
23 this.items = [ | 23 var form = Ext.create('Lada.view.proben.CreateForm'); |
24 { | 24 this.items = [form]; |
25 //Define the form | |
26 xtype: 'form', | |
27 bodyPadding: '10 10', | |
28 border: 0, | |
29 items: [ | |
30 // Probenangaben | |
31 { | |
32 xtype: 'fieldset', | |
33 title: 'Probenangaben', | |
34 defaults: { | |
35 labelWidth: 150 | |
36 }, | |
37 items: [ | |
38 { | |
39 xtype: 'textfield', | |
40 name: 'mstId', | |
41 fieldLabel: 'Messstelle' | |
42 }, | |
43 { | |
44 xtype: 'textfield', | |
45 name: 'hauptprobenNr', | |
46 fieldLabel: 'Hauptprobennr.' | |
47 }, | |
48 { | |
49 xtype: 'textfield', | |
50 name: 'probeId', | |
51 fieldLabel: 'Probe-ID' | |
52 }, | |
53 { | |
54 xtype: 'fieldset', | |
55 title: 'Erweiterte Probenangaben', | |
56 collapsible: true, | |
57 collapsed: false, | |
58 items: [ | |
59 { | |
60 xtype: 'datenbasis', | |
61 id: 'datenbasis', | |
62 editable: false, | |
63 name: 'datenbasisId', | |
64 fieldLabel: 'Datenbasis' | |
65 }, | |
66 { | |
67 xtype: 'betriebsart', | |
68 name: 'baId', | |
69 fieldLabel: 'Betriebsart' | |
70 }, | |
71 { | |
72 xtype: 'testdatensatz', | |
73 name: 'test', | |
74 fieldLabel: 'Testdatensatz' | |
75 }, | |
76 { | |
77 xtype: 'probenart', | |
78 id: 'probenart', | |
79 editable: false, | |
80 name: 'probenartId', | |
81 fieldLabel: 'Probenart' | |
82 }, | |
83 { | |
84 xtype: 'textfield', | |
85 name: 'probenartId', | |
86 fieldLabel: 'Probennehmer' | |
87 }, | |
88 { | |
89 xtype: 'textfield', | |
90 name: 'x11', | |
91 fieldLabel: 'Datensatzerzeuger' | |
92 } | |
93 ] | |
94 } | |
95 ] | |
96 }, | |
97 // Medium | |
98 { | |
99 xtype: 'fieldset', | |
100 title: 'Medium', | |
101 defaults: { | |
102 labelWidth: 150 | |
103 }, | |
104 items: [ | |
105 { | |
106 xtype: 'uwb', | |
107 name: 'umwId', | |
108 fieldLabel: 'Umweltbereich' | |
109 }, | |
110 { | |
111 xtype: 'textfield', | |
112 name: 'media', | |
113 fieldLabel: 'Medienbezeichnung' | |
114 }, | |
115 { | |
116 xtype: 'textfield', | |
117 name: 'mediaDesk', | |
118 fieldLabel: 'Deskriptoren' | |
119 }, | |
120 { | |
121 xtype: 'fieldset', | |
122 title: 'Details Deskriptoren', | |
123 collapsible: true, | |
124 collapsed: true, | |
125 defaultType: 'textfield', | |
126 items: this.buildDescriptors() | |
127 } | |
128 ] | |
129 }, | |
130 // Zeit | |
131 { | |
132 xtype: 'fieldset', | |
133 title: 'Zeit', | |
134 defaultType: 'datefield', | |
135 defaults: { | |
136 labelWidth: 150 | |
137 }, | |
138 items: [ | |
139 { | |
140 fieldLabel: 'Probennahme Beginn', | |
141 name: 'probeentnahmeBeginn' | |
142 }, | |
143 { | |
144 fieldLabel: 'Probennahme Ende', | |
145 name: 'probeentnahmeEnde' | |
146 }, | |
147 { | |
148 fieldLabel: 'Sollzeit Von', | |
149 name: 'solldatumBeginn' | |
150 }, | |
151 { | |
152 fieldLabel: 'Sollzeit Bis', | |
153 name: 'solldatumEnde' | |
154 }, | |
155 { | |
156 fieldLabel: 'Ursprungszeit', | |
157 name: 'z5' | |
158 } | |
159 ] | |
160 } | |
161 ] | |
162 } | |
163 ]; | |
164 | |
165 this.buttons = [ | 25 this.buttons = [ |
166 { | 26 { |
167 text: 'Speichern', | 27 text: 'Speichern', |
168 action: 'save' | 28 handler: form.commit, |
169 }, | 29 scope: form |
170 { | |
171 text: 'Verwerfen', | |
172 scope: this, | |
173 handler: this.close | |
174 } | 30 } |
175 ]; | 31 ]; |
176 this.callParent(arguments); | 32 this.callParent(); |
177 }, | |
178 buildDescriptors: function() { | |
179 var fields = new Array(); | |
180 for ($i=0; $i<12; $i++) { | |
181 fields[$i] = {fieldLabel: 'S'+$i, name: 's'+$i}; | |
182 } | |
183 return fields; | |
184 } | 33 } |
185 }); | 34 }); |
186 |