Mercurial > lada > lada-client
annotate app/view/proben/Edit.js @ 503:369917727c86
Refactored proben edit window.
author | Raimund Renkert <raimund.renkert@intevation.de> |
---|---|
date | Thu, 11 Dec 2014 18:54:21 +0100 |
parents | 8b4ec61c5752 |
children | 44e054626bdd |
rev | line source |
---|---|
472
debfcc7713e3
Added license header to each file.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
422
diff
changeset
|
1 /* Copyright (C) 2013 by Bundesamt fuer Strahlenschutz |
debfcc7713e3
Added license header to each file.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
422
diff
changeset
|
2 * Software engineering by Intevation GmbH |
debfcc7713e3
Added license header to each file.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
422
diff
changeset
|
3 * |
debfcc7713e3
Added license header to each file.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
422
diff
changeset
|
4 * This file is Free Software under the GNU GPL (v>=3) |
debfcc7713e3
Added license header to each file.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
422
diff
changeset
|
5 * and comes with ABSOLUTELY NO WARRANTY! Check out |
497
7c0653e8d9f7
Fixed some js related issues (unused vars, arrays, etc.) and code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
491
diff
changeset
|
6 * the documentation coming with IMIS-Labordaten-Application for details. |
472
debfcc7713e3
Added license header to each file.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
422
diff
changeset
|
7 */ |
debfcc7713e3
Added license header to each file.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
422
diff
changeset
|
8 |
348
6007d11b81c2
Added documentation
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
270
diff
changeset
|
9 /* |
6007d11b81c2
Added documentation
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
270
diff
changeset
|
10 * Window to edit a Probe |
6007d11b81c2
Added documentation
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
270
diff
changeset
|
11 */ |
18
9e1a40312bbe
Implemented a basic edit dialog. Data will be set to data/proben2.json url
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff
changeset
|
12 Ext.define('Lada.view.proben.Edit', { |
9e1a40312bbe
Implemented a basic edit dialog. Data will be set to data/proben2.json url
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff
changeset
|
13 extend: 'Ext.window.Window', |
9e1a40312bbe
Implemented a basic edit dialog. Data will be set to data/proben2.json url
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff
changeset
|
14 alias: 'widget.probenedit', |
9e1a40312bbe
Implemented a basic edit dialog. Data will be set to data/proben2.json url
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff
changeset
|
15 |
498
c1b77fb96b01
Have consistent requires in classes.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
497
diff
changeset
|
16 requires: [ |
c1b77fb96b01
Have consistent requires in classes.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
497
diff
changeset
|
17 'Lada.view.proben.EditForm' |
c1b77fb96b01
Have consistent requires in classes.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
497
diff
changeset
|
18 ], |
c1b77fb96b01
Have consistent requires in classes.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
497
diff
changeset
|
19 |
18
9e1a40312bbe
Implemented a basic edit dialog. Data will be set to data/proben2.json url
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff
changeset
|
20 title: 'Maske für §3-Proben', |
47
e6d5177a9f6f
Set size of the edit window relative to the available space in the browser.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
46
diff
changeset
|
21 // Make size of the dialog dependend of the available space. |
e6d5177a9f6f
Set size of the edit window relative to the available space in the browser.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
46
diff
changeset
|
22 // TODO: Handle resizing the browser window. |
18
9e1a40312bbe
Implemented a basic edit dialog. Data will be set to data/proben2.json url
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff
changeset
|
23 autoShow: true, |
25
f964a50bfe57
Restructured the application. Fixed layouts etc.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
22
diff
changeset
|
24 autoScroll: true, |
f964a50bfe57
Restructured the application. Fixed layouts etc.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
22
diff
changeset
|
25 modal: true, |
503
369917727c86
Refactored proben edit window.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
499
diff
changeset
|
26 layout: 'fit', |
18
9e1a40312bbe
Implemented a basic edit dialog. Data will be set to data/proben2.json url
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff
changeset
|
27 |
9e1a40312bbe
Implemented a basic edit dialog. Data will be set to data/proben2.json url
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff
changeset
|
28 initComponent: function() { |
491
850ccfe5f3c4
Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
490
diff
changeset
|
29 this.buttons = [{ |
850ccfe5f3c4
Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
490
diff
changeset
|
30 text: 'Speichern', |
850ccfe5f3c4
Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
490
diff
changeset
|
31 action: 'save' |
850ccfe5f3c4
Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
490
diff
changeset
|
32 }, { |
850ccfe5f3c4
Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
490
diff
changeset
|
33 text: 'Abbrechen', |
850ccfe5f3c4
Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
490
diff
changeset
|
34 scope: this, |
850ccfe5f3c4
Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
490
diff
changeset
|
35 handler: this.close |
850ccfe5f3c4
Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
490
diff
changeset
|
36 }]; |
503
369917727c86
Refactored proben edit window.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
499
diff
changeset
|
37 this.width = 700// Ext.getBody().getViewSize().width - 30; |
479
d00cc841a876
Set size on initialize in windows.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
472
diff
changeset
|
38 this.height = Ext.getBody().getViewSize().height - 30; |
71
db26aeebe521
Added new Form for editing proben. Use this form in the edit window.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
53
diff
changeset
|
39 // InitialConfig is the config object passed to the constructor on |
db26aeebe521
Added new Form for editing proben. Use this form in the edit window.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
53
diff
changeset
|
40 // creation of this window. We need to pass it throuh to the form as |
db26aeebe521
Added new Form for editing proben. Use this form in the edit window.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
53
diff
changeset
|
41 // we need the "modelId" param to load the correct item. |
503
369917727c86
Refactored proben edit window.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
499
diff
changeset
|
42 |
369917727c86
Refactored proben edit window.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
499
diff
changeset
|
43 /* |
369917727c86
Refactored proben edit window.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
499
diff
changeset
|
44 this.items = [{ |
369917727c86
Refactored proben edit window.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
499
diff
changeset
|
45 xtype: 'fieldset', |
369917727c86
Refactored proben edit window.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
499
diff
changeset
|
46 title: 'Probenangaben', |
369917727c86
Refactored proben edit window.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
499
diff
changeset
|
47 layout: 'hbox', |
369917727c86
Refactored proben edit window.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
499
diff
changeset
|
48 defaults: { |
369917727c86
Refactored proben edit window.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
499
diff
changeset
|
49 labelWidth: 150 |
369917727c86
Refactored proben edit window.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
499
diff
changeset
|
50 }, |
369917727c86
Refactored proben edit window.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
499
diff
changeset
|
51 items: [{ |
369917727c86
Refactored proben edit window.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
499
diff
changeset
|
52 layout: 'vbox', |
369917727c86
Refactored proben edit window.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
499
diff
changeset
|
53 border: 0, |
369917727c86
Refactored proben edit window.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
499
diff
changeset
|
54 items: [{ |
369917727c86
Refactored proben edit window.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
499
diff
changeset
|
55 xtype: 'mst', |
369917727c86
Refactored proben edit window.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
499
diff
changeset
|
56 name: 'mstId', |
369917727c86
Refactored proben edit window.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
499
diff
changeset
|
57 fieldLabel: 'Messstelle', |
369917727c86
Refactored proben edit window.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
499
diff
changeset
|
58 allowBlank: false |
369917727c86
Refactored proben edit window.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
499
diff
changeset
|
59 }, { |
369917727c86
Refactored proben edit window.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
499
diff
changeset
|
60 xtype: 'textfield', |
369917727c86
Refactored proben edit window.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
499
diff
changeset
|
61 name: 'hauptprobenNr', |
369917727c86
Refactored proben edit window.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
499
diff
changeset
|
62 maxLength: 20, |
369917727c86
Refactored proben edit window.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
499
diff
changeset
|
63 fieldLabel: 'Hauptprobennr.' |
369917727c86
Refactored proben edit window.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
499
diff
changeset
|
64 }] |
369917727c86
Refactored proben edit window.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
499
diff
changeset
|
65 }] |
369917727c86
Refactored proben edit window.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
499
diff
changeset
|
66 */ |
369917727c86
Refactored proben edit window.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
499
diff
changeset
|
67 /* |
369917727c86
Refactored proben edit window.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
499
diff
changeset
|
68 items: [{ |
369917727c86
Refactored proben edit window.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
499
diff
changeset
|
69 layout: 'hbox', |
369917727c86
Refactored proben edit window.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
499
diff
changeset
|
70 border: 0, |
369917727c86
Refactored proben edit window.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
499
diff
changeset
|
71 items: [{ |
369917727c86
Refactored proben edit window.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
499
diff
changeset
|
72 layout: 'vbox', |
369917727c86
Refactored proben edit window.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
499
diff
changeset
|
73 border: 0, |
369917727c86
Refactored proben edit window.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
499
diff
changeset
|
74 items: [{ |
369917727c86
Refactored proben edit window.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
499
diff
changeset
|
75 xtype: 'mst', |
369917727c86
Refactored proben edit window.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
499
diff
changeset
|
76 name: 'mstId', |
369917727c86
Refactored proben edit window.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
499
diff
changeset
|
77 fieldLabel: 'Messstelle', |
369917727c86
Refactored proben edit window.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
499
diff
changeset
|
78 allowBlank: false |
369917727c86
Refactored proben edit window.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
499
diff
changeset
|
79 }, { |
369917727c86
Refactored proben edit window.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
499
diff
changeset
|
80 xtype: 'textfield', |
369917727c86
Refactored proben edit window.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
499
diff
changeset
|
81 name: 'hauptprobenNr', |
369917727c86
Refactored proben edit window.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
499
diff
changeset
|
82 maxLength: 20, |
369917727c86
Refactored proben edit window.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
499
diff
changeset
|
83 fieldLabel: 'Hauptprobennr.' |
369917727c86
Refactored proben edit window.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
499
diff
changeset
|
84 }] |
369917727c86
Refactored proben edit window.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
499
diff
changeset
|
85 }, { |
369917727c86
Refactored proben edit window.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
499
diff
changeset
|
86 xtype: 'fieldset', |
369917727c86
Refactored proben edit window.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
499
diff
changeset
|
87 title: 'Erweiterte Probenangaben', |
369917727c86
Refactored proben edit window.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
499
diff
changeset
|
88 collapsible: true, |
369917727c86
Refactored proben edit window.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
499
diff
changeset
|
89 collapsed: true, |
369917727c86
Refactored proben edit window.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
499
diff
changeset
|
90 items: [{ |
369917727c86
Refactored proben edit window.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
499
diff
changeset
|
91 xtype: 'datenbasis', |
369917727c86
Refactored proben edit window.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
499
diff
changeset
|
92 id: 'datenbasis', |
369917727c86
Refactored proben edit window.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
499
diff
changeset
|
93 editable: false, |
369917727c86
Refactored proben edit window.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
499
diff
changeset
|
94 name: 'datenbasisId', |
369917727c86
Refactored proben edit window.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
499
diff
changeset
|
95 fieldLabel: 'Datenbasis' |
369917727c86
Refactored proben edit window.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
499
diff
changeset
|
96 }, { |
369917727c86
Refactored proben edit window.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
499
diff
changeset
|
97 xtype: 'betriebsart', |
369917727c86
Refactored proben edit window.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
499
diff
changeset
|
98 name: 'baId', |
369917727c86
Refactored proben edit window.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
499
diff
changeset
|
99 fieldLabel: 'Betriebsart' |
369917727c86
Refactored proben edit window.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
499
diff
changeset
|
100 }, { |
369917727c86
Refactored proben edit window.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
499
diff
changeset
|
101 xtype: 'testdatensatz', |
369917727c86
Refactored proben edit window.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
499
diff
changeset
|
102 name: 'test', |
369917727c86
Refactored proben edit window.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
499
diff
changeset
|
103 fieldLabel: 'Testdatensatz', |
369917727c86
Refactored proben edit window.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
499
diff
changeset
|
104 allowBlank: false |
369917727c86
Refactored proben edit window.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
499
diff
changeset
|
105 }, { |
369917727c86
Refactored proben edit window.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
499
diff
changeset
|
106 xtype: 'probenart', |
369917727c86
Refactored proben edit window.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
499
diff
changeset
|
107 id: 'probenart', |
369917727c86
Refactored proben edit window.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
499
diff
changeset
|
108 editable: false, |
369917727c86
Refactored proben edit window.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
499
diff
changeset
|
109 name: 'probenartId', |
369917727c86
Refactored proben edit window.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
499
diff
changeset
|
110 fieldLabel: 'Probenart', |
369917727c86
Refactored proben edit window.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
499
diff
changeset
|
111 allowBlank: false |
369917727c86
Refactored proben edit window.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
499
diff
changeset
|
112 }, { |
369917727c86
Refactored proben edit window.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
499
diff
changeset
|
113 xtype: 'numberfield', |
369917727c86
Refactored proben edit window.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
499
diff
changeset
|
114 allowDecimals: false, |
369917727c86
Refactored proben edit window.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
499
diff
changeset
|
115 name: 'probeNehmerId', |
369917727c86
Refactored proben edit window.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
499
diff
changeset
|
116 fieldLabel: 'Probennehmer' |
369917727c86
Refactored proben edit window.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
499
diff
changeset
|
117 }, { |
369917727c86
Refactored proben edit window.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
499
diff
changeset
|
118 xtype: 'netzbetreiber', |
369917727c86
Refactored proben edit window.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
499
diff
changeset
|
119 name: 'netzbetreiberId', |
369917727c86
Refactored proben edit window.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
499
diff
changeset
|
120 editable: false, |
369917727c86
Refactored proben edit window.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
499
diff
changeset
|
121 fieldLabel: 'Netzbetreiber', |
369917727c86
Refactored proben edit window.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
499
diff
changeset
|
122 allowBlank: false |
369917727c86
Refactored proben edit window.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
499
diff
changeset
|
123 }, { |
369917727c86
Refactored proben edit window.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
499
diff
changeset
|
124 xtype: 'textfield', |
369917727c86
Refactored proben edit window.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
499
diff
changeset
|
125 name: 'x11', |
369917727c86
Refactored proben edit window.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
499
diff
changeset
|
126 fieldLabel: 'Datensatzerzeuger' |
369917727c86
Refactored proben edit window.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
499
diff
changeset
|
127 }] |
369917727c86
Refactored proben edit window.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
499
diff
changeset
|
128 }] |
369917727c86
Refactored proben edit window.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
499
diff
changeset
|
129 }] |
369917727c86
Refactored proben edit window.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
499
diff
changeset
|
130 */ |
369917727c86
Refactored proben edit window.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
499
diff
changeset
|
131 // }]; |
491
850ccfe5f3c4
Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
490
diff
changeset
|
132 var form = Ext.create('Lada.view.proben.EditForm', |
850ccfe5f3c4
Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
490
diff
changeset
|
133 this.initialConfig); |
503
369917727c86
Refactored proben edit window.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
499
diff
changeset
|
134 this.items = [{ |
369917727c86
Refactored proben edit window.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
499
diff
changeset
|
135 border: 0, |
369917727c86
Refactored proben edit window.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
499
diff
changeset
|
136 autoScroll: true, |
369917727c86
Refactored proben edit window.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
499
diff
changeset
|
137 items: [form] |
369917727c86
Refactored proben edit window.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
499
diff
changeset
|
138 }]; |
369917727c86
Refactored proben edit window.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
499
diff
changeset
|
139 this.callParent(arguments); |
422
f9bb1ecf6462
Removed trailing commas.
Raimund Renkert <rrenkert@intevation.de>
parents:
348
diff
changeset
|
140 } |
18
9e1a40312bbe
Implemented a basic edit dialog. Data will be set to data/proben2.json url
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff
changeset
|
141 }); |