annotate app/view/proben/Edit.js @ 111:6273b73b4b27

Replaced Logic for Kommentare. Use copied code form Orte.
author Torsten Irländer <torsten.irlaender@intevation.de>
date Wed, 19 Jun 2013 14:11:35 +0200
parents b91d5376db19
children c05fda928b82
rev   line source
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
1 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
2 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
3 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
4
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
5 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
6 // 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
7 // TODO: Handle resizing the browser window.
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
8 width: Ext.getBody().getViewSize().width - 30,
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
9 height: Ext.getBody().getViewSize().height - 30,
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
10 autoShow: true,
25
f964a50bfe57 Restructured the application. Fixed layouts etc.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 22
diff changeset
11 autoScroll: true,
f964a50bfe57 Restructured the application. Fixed layouts etc.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 22
diff changeset
12 modal: true,
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
13
40
f9b6de636ad0 Added probenart combobox
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 38
diff changeset
14 requires: [
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
15 'Lada.view.proben.EditForm',
42
5ed477590736 Added missiong code for uwb.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 41
diff changeset
16 'Lada.view.widgets.Uwb',
41
a1be7ccd4d0c Added datenbasis combobox
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 40
diff changeset
17 'Lada.view.widgets.Datenbasis',
46
39f5f1529847 Added combotbox for Betriebsart.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 45
diff changeset
18 'Lada.view.widgets.Probenart',
49
792c34b3f5a9 Added combobox for field "testdatensatz"
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 47
diff changeset
19 'Lada.view.widgets.Betriebsart',
53
73bc17de6ff2 Added store, view and model for kommentare. Load kommentare when opening a probe.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 49
diff changeset
20 'Lada.view.widgets.Testdatensatz',
91
95b08b96f5c9 Added new widget for the netzbetreiber.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 71
diff changeset
21 'Lada.view.widgets.Netzbetreiber',
94
21c069e2ecdb Added Orte to the Proben edit window
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 91
diff changeset
22 'Lada.view.kommentare.List',
103
3552b0ee4526 Added Messungenlist to the Proben eddit view.
Torsten Irländer <torsten@irlaender.de>
parents: 94
diff changeset
23 'Lada.view.orte.List',
106
b91d5376db19 Load Zusatzwerte from server
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 103
diff changeset
24 'Lada.view.messungen.List',
b91d5376db19 Load Zusatzwerte from server
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 103
diff changeset
25 'Lada.view.zusatzwerte.List'
40
f9b6de636ad0 Added probenart combobox
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 38
diff changeset
26 ],
f9b6de636ad0 Added probenart combobox
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 38
diff changeset
27
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
28 initComponent: function() {
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
29 // 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
30 // 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
31 // we need the "modelId" param to load the correct item.
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
32 var form = Ext.create('Lada.view.proben.EditForm', this.initialConfig);
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
33 // Load kommentare
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
34 //var record = form.getRecord();
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
35 var kommentare = form.down('kommentarelist'); //form.down('kommentare');
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
36 var kstore = kommentare.getStore();
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
37 kstore.load({
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
38 params: {
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 probe: this.initialConfig['modelId']
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 //probe: record.data['probeId']
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
41 }
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
42 });
94
21c069e2ecdb Added Orte to the Proben edit window
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 91
diff changeset
43 // Load Orte
21c069e2ecdb Added Orte to the Proben edit window
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 91
diff changeset
44 var orte = form.down('ortelist');
21c069e2ecdb Added Orte to the Proben edit window
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 91
diff changeset
45 var ostore = orte.getStore();
21c069e2ecdb Added Orte to the Proben edit window
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 91
diff changeset
46 ostore.load({
21c069e2ecdb Added Orte to the Proben edit window
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 91
diff changeset
47 params: {
21c069e2ecdb Added Orte to the Proben edit window
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 91
diff changeset
48 probe: this.initialConfig['modelId']
21c069e2ecdb Added Orte to the Proben edit window
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 91
diff changeset
49 //probe: record.data['probeId']
21c069e2ecdb Added Orte to the Proben edit window
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 91
diff changeset
50 }
21c069e2ecdb Added Orte to the Proben edit window
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 91
diff changeset
51 });
106
b91d5376db19 Load Zusatzwerte from server
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 103
diff changeset
52 // Load Zusatzwerte
b91d5376db19 Load Zusatzwerte from server
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 103
diff changeset
53 var zwerte = form.down('zusatzwertelist');
b91d5376db19 Load Zusatzwerte from server
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 103
diff changeset
54 var zstore = zwerte.getStore();
b91d5376db19 Load Zusatzwerte from server
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 103
diff changeset
55 zstore.load({
b91d5376db19 Load Zusatzwerte from server
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 103
diff changeset
56 params: {
b91d5376db19 Load Zusatzwerte from server
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 103
diff changeset
57 probe: this.initialConfig['modelId']
b91d5376db19 Load Zusatzwerte from server
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 103
diff changeset
58 //probe: record.data['probeId']
b91d5376db19 Load Zusatzwerte from server
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 103
diff changeset
59 }
b91d5376db19 Load Zusatzwerte from server
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 103
diff changeset
60 });
103
3552b0ee4526 Added Messungenlist to the Proben eddit view.
Torsten Irländer <torsten@irlaender.de>
parents: 94
diff changeset
61 // Load Messungen
3552b0ee4526 Added Messungenlist to the Proben eddit view.
Torsten Irländer <torsten@irlaender.de>
parents: 94
diff changeset
62 var messungen = form.down('messungenlist');
3552b0ee4526 Added Messungenlist to the Proben eddit view.
Torsten Irländer <torsten@irlaender.de>
parents: 94
diff changeset
63 var mstore = messungen.getStore();
3552b0ee4526 Added Messungenlist to the Proben eddit view.
Torsten Irländer <torsten@irlaender.de>
parents: 94
diff changeset
64 mstore.load({
3552b0ee4526 Added Messungenlist to the Proben eddit view.
Torsten Irländer <torsten@irlaender.de>
parents: 94
diff changeset
65 params: {
3552b0ee4526 Added Messungenlist to the Proben eddit view.
Torsten Irländer <torsten@irlaender.de>
parents: 94
diff changeset
66 probe: this.initialConfig['modelId']
3552b0ee4526 Added Messungenlist to the Proben eddit view.
Torsten Irländer <torsten@irlaender.de>
parents: 94
diff changeset
67 //probe: record.data['probeId']
3552b0ee4526 Added Messungenlist to the Proben eddit view.
Torsten Irländer <torsten@irlaender.de>
parents: 94
diff changeset
68 }
3552b0ee4526 Added Messungenlist to the Proben eddit view.
Torsten Irländer <torsten@irlaender.de>
parents: 94
diff changeset
69 });
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
70 this.items = [form];
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
71 this.buttons = [
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
72 {
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
73 text: 'Speichern',
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
74 handler: form.commit,
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
75 scope: form
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
76 }
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
77 ];
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
78 this.callParent();
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
79 }
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
80 });
22
0a4674f17bcb Added more fields to the overview and set correct reference in on the edit
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 19
diff changeset
81

http://lada.wald.intevation.org