Mercurial > lada > lada-client
annotate app/view/window/MessungEdit.js @ 595:a81dafe06d1d
Add status to messung edit window.
author | Raimund Renkert <raimund.renkert@intevation.de> |
---|---|
date | Thu, 12 Mar 2015 09:47:42 +0100 |
parents | e440b66a859f |
children | d2ce1c4c3aad |
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', |
576
0d4137e0fe36
Added a blank window to edit a Messung
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
18 // 'Lada.view.grid.MKommentar' |
595
a81dafe06d1d
Add status to messung edit window.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
590
diff
changeset
|
19 'Lada.view.grid.Messwert', |
a81dafe06d1d
Add status to messung edit window.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
590
diff
changeset
|
20 'Lada.view.grid.Status', |
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', |
0d4137e0fe36
Added a blank window to edit a Messung
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
75 title: 'Messungskommentare - Stub' |
590
e440b66a859f
Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
581
diff
changeset
|
76 // TODO |
576
0d4137e0fe36
Added a blank window to edit a Messung
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
77 }] |
0d4137e0fe36
Added a blank window to edit a Messung
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
78 }]; |
0d4137e0fe36
Added a blank window to edit a Messung
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
79 this.callParent(arguments); |
0d4137e0fe36
Added a blank window to edit a Messung
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
80 }, |
0d4137e0fe36
Added a blank window to edit a Messung
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
81 |
0d4137e0fe36
Added a blank window to edit a Messung
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
82 initData: function() { |
0d4137e0fe36
Added a blank window to edit a Messung
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
83 this.clearMessages(); |
0d4137e0fe36
Added a blank window to edit a Messung
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
84 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
|
85 failure: function(record) { |
e440b66a859f
Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
581
diff
changeset
|
86 // TODO |
e440b66a859f
Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
581
diff
changeset
|
87 console.log(record); |
576
0d4137e0fe36
Added a blank window to edit a Messung
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
88 }, |
590
e440b66a859f
Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
581
diff
changeset
|
89 success: function(record, response) { |
e440b66a859f
Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
581
diff
changeset
|
90 this.down('messungform').setRecord(record); |
e440b66a859f
Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
581
diff
changeset
|
91 var json = Ext.decode(response.response.responseText); |
e440b66a859f
Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
581
diff
changeset
|
92 if (json) { |
e440b66a859f
Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
581
diff
changeset
|
93 this.setMessages(json.errors, json.warnings); |
e440b66a859f
Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
581
diff
changeset
|
94 } |
576
0d4137e0fe36
Added a blank window to edit a Messung
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
95 }, |
0d4137e0fe36
Added a blank window to edit a Messung
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
96 scope: this |
0d4137e0fe36
Added a blank window to edit a Messung
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
97 } |
0d4137e0fe36
Added a blank window to edit a Messung
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
98 ); |
0d4137e0fe36
Added a blank window to edit a Messung
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
99 }, |
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 setMessages: function(errors, warnings) { |
0d4137e0fe36
Added a blank window to edit a Messung
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
102 //todo this is a stub |
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 clearMessages: function() { |
0d4137e0fe36
Added a blank window to edit a Messung
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
105 //todo this is a stub |
0d4137e0fe36
Added a blank window to edit a Messung
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
106 } |
0d4137e0fe36
Added a blank window to edit a Messung
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
107 |
0d4137e0fe36
Added a blank window to edit a Messung
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
108 }); |