Mercurial > lada > lada-client
comparison app/view/proben/EditForm.js @ 515:66f3c5d258e2
Added save and discard buttons to proben header fields and listen to changes to enable or disable buttons.
author | Raimund Renkert <raimund.renkert@intevation.de> |
---|---|
date | Tue, 16 Dec 2014 13:21:54 +0100 |
parents | 2b5aa0e6e641 |
children | 48593a6181c9 |
comparison
equal
deleted
inserted
replaced
514:61c76c12bd28 | 515:66f3c5d258e2 |
---|---|
27 | 27 |
28 model: 'Lada.model.Probe', | 28 model: 'Lada.model.Probe', |
29 minWidth: 650, | 29 minWidth: 650, |
30 | 30 |
31 initComponent: function() { | 31 initComponent: function() { |
32 var me = this; | |
32 this.items = [{ | 33 this.items = [{ |
33 xtype: 'fieldset', | 34 xtype: 'fieldset', |
34 title: 'Allgemein', | 35 title: 'Allgemein', |
35 defaults: { | 36 items: [{ |
36 labelWidth: 160 | |
37 }, | |
38 items: [{ | |
39 layout: 'hbox', | |
40 border: 0, | 37 border: 0, |
38 margin: '0, 0, 10, 0', | |
39 dockedItems: [{ | |
40 xtype: 'toolbar', | |
41 dock: 'bottom', | |
42 border: '0, 1, 1, 1', | |
43 style: { | |
44 borderBottom: '1px solid #b5b8c8 !important', | |
45 borderLeft: '1px solid #b5b8c8 !important', | |
46 borderRight: '1px solid #b5b8c8 !important' | |
47 }, | |
48 items: ['->', { | |
49 text: 'Speichern', | |
50 qtip: 'Daten speichern', | |
51 icon: 'gfx/dialog-ok-apply.png', | |
52 action: 'save', | |
53 scope: me, | |
54 handler: this.commit | |
55 }, { | |
56 text: 'Verwerfen', | |
57 qtip: 'Ă„nderungen verwerfen', | |
58 icon: 'gfx/dialog-cancel.png', | |
59 action: 'discard', | |
60 disabled: true, | |
61 scope: this, | |
62 handler: this.reset | |
63 }] | |
64 }], | |
65 items: [{ | |
66 layout: 'hbox', | |
67 border: 0, | |
68 items: [{ | |
69 border: 0, | |
70 width: '43%', | |
71 minWidth: 290, | |
72 items: [{ | |
73 xtype: 'mst', | |
74 name: 'mstId', | |
75 fieldLabel: 'Messstelle', | |
76 allowBlank: false, | |
77 listeners: { | |
78 dirtychange: { | |
79 fn: this.updateOnChange, | |
80 scope: me | |
81 } | |
82 } | |
83 }, { | |
84 xtype: 'textfield', | |
85 name: 'hauptprobenNr', | |
86 maxLength: 20, | |
87 fieldLabel: 'Hauptprobennr.', | |
88 listeners: { | |
89 dirtychange: { | |
90 fn: this.updateOnChange, | |
91 scope: me | |
92 } | |
93 } | |
94 }] | |
95 }, { | |
96 border: 0, | |
97 width: '52%', | |
98 minWidth: 300, | |
99 items: [{ | |
100 xtype: 'fieldset', | |
101 title: 'Erweiterte Angaben', | |
102 collapsible: true, | |
103 collapsed: true, | |
104 items: [{ | |
105 xtype: 'datenbasis', | |
106 id: 'datenbasis', | |
107 editable: false, | |
108 name: 'datenbasisId', | |
109 fieldLabel: 'Datenbasis', | |
110 listeners: { | |
111 dirtychange: { | |
112 fn: this.updateOnChange, | |
113 scope: me | |
114 } | |
115 } | |
116 }, { | |
117 xtype: 'betriebsart', | |
118 name: 'baId', | |
119 fieldLabel: 'Betriebsart', | |
120 listeners: { | |
121 dirtychange: { | |
122 fn: this.updateOnChange, | |
123 scope: me | |
124 } | |
125 } | |
126 }, { | |
127 xtype: 'testdatensatz', | |
128 name: 'test', | |
129 fieldLabel: 'Testdatensatz', | |
130 allowBlank: false, | |
131 listeners: { | |
132 dirtychange: { | |
133 fn: this.updateOnChange, | |
134 scope: me | |
135 } | |
136 } | |
137 }, { | |
138 xtype: 'probenart', | |
139 id: 'probenart', | |
140 editable: false, | |
141 name: 'probenartId', | |
142 fieldLabel: 'Probenart', | |
143 allowBlank: false, | |
144 listeners: { | |
145 dirtychange: { | |
146 fn: this.updateOnChange, | |
147 scope: me | |
148 } | |
149 } | |
150 }, { | |
151 xtype: 'numberfield', | |
152 allowDecimals: false, | |
153 name: 'probeNehmerId', | |
154 fieldLabel: 'Probennehmer', | |
155 listeners: { | |
156 dirtychange: { | |
157 fn: this.updateOnChange, | |
158 scope: me | |
159 } | |
160 } | |
161 }, { | |
162 xtype: 'netzbetreiber', | |
163 name: 'netzbetreiberId', | |
164 editable: false, | |
165 fieldLabel: 'Netzbetreiber', | |
166 allowBlank: false, | |
167 listeners: { | |
168 dirtychange: { | |
169 fn: this.updateOnChange, | |
170 scope: me | |
171 } | |
172 } | |
173 }, { | |
174 xtype: 'textfield', | |
175 name: 'x11', | |
176 fieldLabel: 'Datensatzerzeuger', | |
177 listeners: { | |
178 dirtychange: { | |
179 fn: this.updateOnChange, | |
180 scope: me | |
181 } | |
182 } | |
183 }] | |
184 }] | |
185 }] | |
186 }, { | |
187 // Medium | |
188 xtype: 'fieldset', | |
189 title: 'Medium', | |
41 items: [{ | 190 items: [{ |
42 border: 0, | 191 border: 0, |
43 width: '43%', | 192 layout: { |
44 minWidth: 290, | 193 type: 'vbox', |
194 align: 'stretch' | |
195 }, | |
196 width: '100%', | |
45 items: [{ | 197 items: [{ |
46 xtype: 'mst', | |
47 name: 'mstId', | |
48 fieldLabel: 'Messstelle', | |
49 allowBlank: false | |
50 }, { | |
51 xtype: 'textfield', | 198 xtype: 'textfield', |
52 name: 'hauptprobenNr', | 199 name: 'media', |
53 maxLength: 20, | 200 labelWidth: 110, |
54 fieldLabel: 'Hauptprobennr.' | 201 fieldLabel: 'Medienbezeichnung', |
55 }] | 202 listeners: { |
56 }, { | 203 dirtychange: { |
57 border: 0, | 204 fn: this.updateOnChange, |
58 width: '52%', | 205 scope: me |
59 minWidth: 300, | 206 } |
60 items: [{ | 207 } |
208 }, { | |
209 xtype: 'textfield', | |
210 maxLength: 100, | |
211 name: 'mediaDesk', | |
212 labelWidth: 110, | |
213 fieldLabel: 'Deskriptoren', | |
214 listeners: { | |
215 dirtychange: { | |
216 fn: this.updateOnChange, | |
217 scope: me | |
218 } | |
219 } | |
220 }, { | |
221 xtype: 'uwb', | |
222 name: 'umwId', | |
223 fieldLabel: 'Umweltbereich', | |
224 labelWidth: 110, | |
225 allowBlank: false, | |
226 listeners: { | |
227 dirtychange: { | |
228 fn: this.updateOnChange, | |
229 scope: me | |
230 } | |
231 } | |
232 }, { | |
61 xtype: 'fieldset', | 233 xtype: 'fieldset', |
62 title: 'Erweiterte Angaben', | 234 title: 'Details Deskriptoren', |
63 collapsible: true, | 235 collapsible: true, |
64 collapsed: true, | 236 collapsed: true, |
65 items: [{ | 237 defaultType: 'textfield', |
66 xtype: 'datenbasis', | 238 layout: { |
67 id: 'datenbasis', | 239 type: 'table', |
68 editable: false, | 240 columns: 3 |
69 name: 'datenbasisId', | 241 }, |
70 fieldLabel: 'Datenbasis' | 242 items: this.buildDescriptors(), |
71 }, { | 243 listeners: { |
72 xtype: 'betriebsart', | 244 dirtychange: { |
73 name: 'baId', | 245 fn: this.updateOnChange, |
74 fieldLabel: 'Betriebsart' | 246 scope: me |
75 }, { | 247 } |
76 xtype: 'testdatensatz', | 248 } |
77 name: 'test', | |
78 fieldLabel: 'Testdatensatz', | |
79 allowBlank: false | |
80 }, { | |
81 xtype: 'probenart', | |
82 id: 'probenart', | |
83 editable: false, | |
84 name: 'probenartId', | |
85 fieldLabel: 'Probenart', | |
86 allowBlank: false | |
87 }, { | |
88 xtype: 'numberfield', | |
89 allowDecimals: false, | |
90 name: 'probeNehmerId', | |
91 fieldLabel: 'Probennehmer' | |
92 }, { | |
93 xtype: 'netzbetreiber', | |
94 name: 'netzbetreiberId', | |
95 editable: false, | |
96 fieldLabel: 'Netzbetreiber', | |
97 allowBlank: false | |
98 }, { | |
99 xtype: 'textfield', | |
100 name: 'x11', | |
101 fieldLabel: 'Datensatzerzeuger' | |
102 }] | |
103 }] | 249 }] |
104 }] | 250 }] |
105 }] | 251 }, { |
106 }, { | 252 // Zeit |
107 // Medium | 253 xtype: 'fieldset', |
108 xtype: 'fieldset', | 254 title: 'Zeit', |
109 title: 'Medium', | 255 defaultType: 'datetime', |
110 items: [{ | 256 defaults: { |
111 border: 0, | 257 labelWidth: 150 |
258 }, | |
112 layout: { | 259 layout: { |
113 type: 'vbox', | 260 type: 'table', |
114 align: 'stretch' | 261 columns: 2 |
115 }, | 262 }, |
116 width: '100%', | |
117 items: [{ | 263 items: [{ |
118 xtype: 'textfield', | 264 fieldLabel: 'Probennahme Beginn', |
119 name: 'media', | 265 margin: '0, 10, 5, 0', |
120 labelWidth: 110, | 266 labelWidth: 130, |
121 fieldLabel: 'Medienbezeichnung' | 267 name: 'probeentnahmeBeginn', |
268 listeners: { | |
269 dirtychange: { | |
270 fn: this.updateOnChange, | |
271 scope: me | |
272 } | |
273 } | |
122 }, { | 274 }, { |
123 xtype: 'textfield', | 275 fieldLabel: 'Sollzeit Von', |
124 maxLength: 100, | 276 margin: '0, 10, 5, 0', |
125 name: 'mediaDesk', | 277 labelWidth: 100, |
126 labelWidth: 110, | 278 name: 'solldatumBeginn', |
127 fieldLabel: 'Deskriptoren' | 279 listeners: { |
280 dirtychange: { | |
281 fn: this.updateOnChange, | |
282 scope: me | |
283 } | |
284 } | |
128 }, { | 285 }, { |
129 xtype: 'uwb', | 286 fieldLabel: 'Probennahme Ende', |
130 name: 'umwId', | 287 margin: '0, 10, 5, 0', |
131 fieldLabel: 'Umweltbereich', | 288 labelWidth: 130, |
132 labelWidth: 110, | 289 name: 'probeentnahmeEnde', |
133 allowBlank: false | 290 listeners: { |
291 dirtychange: { | |
292 fn: this.updateOnChange, | |
293 scope: me | |
294 } | |
295 } | |
134 }, { | 296 }, { |
135 xtype: 'fieldset', | 297 fieldLabel: 'Sollzeit Bis', |
136 title: 'Details Deskriptoren', | 298 margin: '0, 10, 5, 0', |
137 collapsible: true, | 299 labelWidth: 100, |
138 collapsed: true, | 300 name: 'solldatumEnde', |
139 defaultType: 'textfield', | 301 listeners: { |
140 layout: { | 302 dirtychange: { |
141 type: 'table', | 303 fn: this.updateOnChange, |
142 columns: 3 | 304 scope: me |
143 }, | 305 } |
144 items: this.buildDescriptors() | 306 } |
145 }] | 307 }] |
146 }] | 308 }] |
147 }, { | 309 }] |
148 // Zeit | |
149 xtype: 'fieldset', | |
150 title: 'Zeit', | |
151 defaultType: 'datetime', | |
152 defaults: { | |
153 labelWidth: 150 | |
154 }, | |
155 layout: { | |
156 type: 'table', | |
157 columns: 2 | |
158 }, | |
159 items: [{ | |
160 fieldLabel: 'Probennahme Beginn', | |
161 margin: '0, 10, 5, 0', | |
162 labelWidth: 130, | |
163 name: 'probeentnahmeBeginn' | |
164 }, { | |
165 fieldLabel: 'Sollzeit Von', | |
166 margin: '0, 10, 5, 0', | |
167 labelWidth: 100, | |
168 name: 'solldatumBeginn' | |
169 }, { | |
170 fieldLabel: 'Probennahme Ende', | |
171 margin: '0, 10, 5, 0', | |
172 labelWidth: 130, | |
173 name: 'probeentnahmeEnde' | |
174 }, { | |
175 fieldLabel: 'Sollzeit Bis', | |
176 margin: '0, 10, 5, 0', | |
177 labelWidth: 100, | |
178 name: 'solldatumEnde' | |
179 }] | |
180 }, { | 310 }, { |
181 // Ortsangaben | 311 // Ortsangaben |
182 xtype: 'fieldset', | 312 xtype: 'fieldset', |
183 title: 'Ortsangaben', | 313 title: 'Ortsangaben', |
184 padding: '10 10', | 314 padding: '10 10', |