annotate app/view/window/MessungEdit.js @ 606:2b2d284bd6e4

Added ort edit window.
author Raimund Renkert <raimund.renkert@intevation.de>
date Thu, 12 Mar 2015 15:53:04 +0100
parents d2ce1c4c3aad
children 8a156a7fbe67
rev   line source
576
0d4137e0fe36 Added a blank window to edit a Messung
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
1 /* Copyright (C) 2013 by Bundesamt fuer Strahlenschutz
0d4137e0fe36 Added a blank window to edit a Messung
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
2 * Software engineering by Intevation GmbH
0d4137e0fe36 Added a blank window to edit a Messung
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
3 *
0d4137e0fe36 Added a blank window to edit a Messung
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
4 * This file is Free Software under the GNU GPL (v>=3)
0d4137e0fe36 Added a blank window to edit a Messung
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
5 * and comes with ABSOLUTELY NO WARRANTY! Check out
0d4137e0fe36 Added a blank window to edit a Messung
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
6 * the documentation coming with IMIS-Labordaten-Application for details.
0d4137e0fe36 Added a blank window to edit a Messung
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
7 */
0d4137e0fe36 Added a blank window to edit a Messung
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
8
0d4137e0fe36 Added a blank window to edit a Messung
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
9 /*
590
e440b66a859f Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 581
diff changeset
10 * Window to edit a Messung
576
0d4137e0fe36 Added a blank window to edit a Messung
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
11 */
0d4137e0fe36 Added a blank window to edit a Messung
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
12 Ext.define('Lada.view.window.MessungEdit', {
0d4137e0fe36 Added a blank window to edit a Messung
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
13 extend: 'Ext.window.Window',
0d4137e0fe36 Added a blank window to edit a Messung
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
14 alias: 'widget.messungedit',
0d4137e0fe36 Added a blank window to edit a Messung
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
15
581
424802824648 Added a form for Messungen (unfinished)
Dustin Demuth <dustin@intevation.de>
parents: 576
diff changeset
16 requires: [
590
e440b66a859f Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 581
diff changeset
17 'Lada.view.form.Messung',
595
a81dafe06d1d Add status to messung edit window.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 590
diff changeset
18 'Lada.view.grid.Messwert',
a81dafe06d1d Add status to messung edit window.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 590
diff changeset
19 'Lada.view.grid.Status',
597
d2ce1c4c3aad Add messung kommentare to messung edit window.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 595
diff changeset
20 'Lada.view.grid.MKommentar'
581
424802824648 Added a form for Messungen (unfinished)
Dustin Demuth <dustin@intevation.de>
parents: 576
diff changeset
21 ],
576
0d4137e0fe36 Added a blank window to edit a Messung
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
22
0d4137e0fe36 Added a blank window to edit a Messung
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
23 collapsible: true,
0d4137e0fe36 Added a blank window to edit a Messung
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
24 maximizable: true,
0d4137e0fe36 Added a blank window to edit a Messung
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
25 autoshow: true,
0d4137e0fe36 Added a blank window to edit a Messung
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
26 autoscroll: true,
0d4137e0fe36 Added a blank window to edit a Messung
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
27 layout: 'fit',
0d4137e0fe36 Added a blank window to edit a Messung
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
28
0d4137e0fe36 Added a blank window to edit a Messung
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
29 record: null,
0d4137e0fe36 Added a blank window to edit a Messung
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
30
590
e440b66a859f Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 581
diff changeset
31 initComponent: function() {
576
0d4137e0fe36 Added a blank window to edit a Messung
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
32 if (this.record === null) {
0d4137e0fe36 Added a blank window to edit a Messung
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
33 Ext.Msg.alert('Keine valide Messung ausgewählt!');
0d4137e0fe36 Added a blank window to edit a Messung
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
34 this.callParent(arguments);
0d4137e0fe36 Added a blank window to edit a Messung
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
35 return;
0d4137e0fe36 Added a blank window to edit a Messung
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
36 }
590
e440b66a859f Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 581
diff changeset
37 this.title = 'Messung ' + this.record.get('nebenprobenNr');
576
0d4137e0fe36 Added a blank window to edit a Messung
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
38 this.buttons = [{
0d4137e0fe36 Added a blank window to edit a Messung
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
39 text: 'Schließen',
0d4137e0fe36 Added a blank window to edit a Messung
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
40 scope: this,
0d4137e0fe36 Added a blank window to edit a Messung
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
41 handler: this.close
0d4137e0fe36 Added a blank window to edit a Messung
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
42 }];
0d4137e0fe36 Added a blank window to edit a Messung
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
43 this.width = 700;
0d4137e0fe36 Added a blank window to edit a Messung
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
44 this.height = Ext.getBody().getViewSize().height - 30;
0d4137e0fe36 Added a blank window to edit a Messung
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
45
0d4137e0fe36 Added a blank window to edit a Messung
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
46 this.items = [{
0d4137e0fe36 Added a blank window to edit a Messung
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
47 border: 0,
0d4137e0fe36 Added a blank window to edit a Messung
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
48 autoScroll: true,
0d4137e0fe36 Added a blank window to edit a Messung
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
49 items: [{
581
424802824648 Added a form for Messungen (unfinished)
Dustin Demuth <dustin@intevation.de>
parents: 576
diff changeset
50 xtype: 'messungform',
590
e440b66a859f Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 581
diff changeset
51 recordId: this.record.get('id')
576
0d4137e0fe36 Added a blank window to edit a Messung
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
52 }, {
0d4137e0fe36 Added a blank window to edit a Messung
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
53 xtype: 'fset',
0d4137e0fe36 Added a blank window to edit a Messung
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
54 name: 'messwerte',
590
e440b66a859f Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 581
diff changeset
55 title: 'Messwerte',
e440b66a859f Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 581
diff changeset
56 padding: '5, 5',
e440b66a859f Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 581
diff changeset
57 margin: 5,
e440b66a859f Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 581
diff changeset
58 items: [{
e440b66a859f Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 581
diff changeset
59 xtype: 'messwertgrid',
e440b66a859f Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 581
diff changeset
60 recordId: this.record.get('id')
e440b66a859f Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 581
diff changeset
61 }]
576
0d4137e0fe36 Added a blank window to edit a Messung
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
62 }, {
0d4137e0fe36 Added a blank window to edit a Messung
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
63 xtype: 'fset',
0d4137e0fe36 Added a blank window to edit a Messung
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
64 name: 'messungstatus',
595
a81dafe06d1d Add status to messung edit window.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 590
diff changeset
65 title: 'Status',
a81dafe06d1d Add status to messung edit window.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 590
diff changeset
66 padding: '5, 5',
a81dafe06d1d Add status to messung edit window.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 590
diff changeset
67 margin: 5,
a81dafe06d1d Add status to messung edit window.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 590
diff changeset
68 items: [{
a81dafe06d1d Add status to messung edit window.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 590
diff changeset
69 xtype: 'statusgrid',
a81dafe06d1d Add status to messung edit window.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 590
diff changeset
70 recordId: this.record.get('id')
a81dafe06d1d Add status to messung edit window.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 590
diff changeset
71 }]
576
0d4137e0fe36 Added a blank window to edit a Messung
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
72 }, {
0d4137e0fe36 Added a blank window to edit a Messung
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
73 xtype: 'fset',
0d4137e0fe36 Added a blank window to edit a Messung
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
74 name: 'messungskommentare',
597
d2ce1c4c3aad Add messung kommentare to messung edit window.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 595
diff changeset
75 title: 'Kommentare',
d2ce1c4c3aad Add messung kommentare to messung edit window.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 595
diff changeset
76 padding: '5, 5',
d2ce1c4c3aad Add messung kommentare to messung edit window.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 595
diff changeset
77 margin: 5,
d2ce1c4c3aad Add messung kommentare to messung edit window.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 595
diff changeset
78 items: [{
d2ce1c4c3aad Add messung kommentare to messung edit window.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 595
diff changeset
79 xtype: 'mkommentargrid',
d2ce1c4c3aad Add messung kommentare to messung edit window.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 595
diff changeset
80 recordId: this.record.get('id')
d2ce1c4c3aad Add messung kommentare to messung edit window.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 595
diff changeset
81 }]
576
0d4137e0fe36 Added a blank window to edit a Messung
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
82 }]
0d4137e0fe36 Added a blank window to edit a Messung
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
83 }];
0d4137e0fe36 Added a blank window to edit a Messung
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
84 this.callParent(arguments);
0d4137e0fe36 Added a blank window to edit a Messung
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
85 },
0d4137e0fe36 Added a blank window to edit a Messung
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
86
0d4137e0fe36 Added a blank window to edit a Messung
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
87 initData: function() {
0d4137e0fe36 Added a blank window to edit a Messung
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
88 this.clearMessages();
0d4137e0fe36 Added a blank window to edit a Messung
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
89 Ext.ClassManager.get('Lada.model.Messung').load(this.record.get('id'), {
590
e440b66a859f Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 581
diff changeset
90 failure: function(record) {
e440b66a859f Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 581
diff changeset
91 // TODO
e440b66a859f Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 581
diff changeset
92 console.log(record);
576
0d4137e0fe36 Added a blank window to edit a Messung
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
93 },
590
e440b66a859f Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 581
diff changeset
94 success: function(record, response) {
e440b66a859f Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 581
diff changeset
95 this.down('messungform').setRecord(record);
e440b66a859f Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 581
diff changeset
96 var json = Ext.decode(response.response.responseText);
e440b66a859f Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 581
diff changeset
97 if (json) {
e440b66a859f Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 581
diff changeset
98 this.setMessages(json.errors, json.warnings);
e440b66a859f Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 581
diff changeset
99 }
576
0d4137e0fe36 Added a blank window to edit a Messung
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
100 },
0d4137e0fe36 Added a blank window to edit a Messung
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
101 scope: this
0d4137e0fe36 Added a blank window to edit a Messung
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
102 }
0d4137e0fe36 Added a blank window to edit a Messung
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
103 );
0d4137e0fe36 Added a blank window to edit a Messung
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
104 },
0d4137e0fe36 Added a blank window to edit a Messung
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
105
0d4137e0fe36 Added a blank window to edit a Messung
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
106 setMessages: function(errors, warnings) {
0d4137e0fe36 Added a blank window to edit a Messung
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
107 //todo this is a stub
0d4137e0fe36 Added a blank window to edit a Messung
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
108 },
0d4137e0fe36 Added a blank window to edit a Messung
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
109 clearMessages: function() {
0d4137e0fe36 Added a blank window to edit a Messung
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
110 //todo this is a stub
0d4137e0fe36 Added a blank window to edit a Messung
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
111 }
0d4137e0fe36 Added a blank window to edit a Messung
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
112
0d4137e0fe36 Added a blank window to edit a Messung
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
113 });

http://lada.wald.intevation.org