annotate app/view/window/MessungEdit.js @ 592:825973ca386f

Updated missing name changes for messung grid.
author Raimund Renkert <raimund.renkert@intevation.de>
date Thu, 12 Mar 2015 09:44:47 +0100
parents e440b66a859f
children a81dafe06d1d
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',
e440b66a859f Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 581
diff changeset
18 'Lada.view.grid.Messwert'
576
0d4137e0fe36 Added a blank window to edit a Messung
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
19 // 'Lada.view.grid.Messstatus',
0d4137e0fe36 Added a blank window to edit a Messung
Dustin Demuth <dustin@intevation.de>
parents:
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 }]
e440b66a859f Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 581
diff changeset
62 // TODO
576
0d4137e0fe36 Added a blank window to edit a Messung
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
63 }, {
0d4137e0fe36 Added a blank window to edit a Messung
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
64 xtype: 'fset',
0d4137e0fe36 Added a blank window to edit a Messung
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
65 name: 'messungstatus',
0d4137e0fe36 Added a blank window to edit a Messung
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
66 title: 'Messungstatus - Stub'
590
e440b66a859f Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 581
diff changeset
67 // TODO
576
0d4137e0fe36 Added a blank window to edit a Messung
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
68 }, {
0d4137e0fe36 Added a blank window to edit a Messung
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
69 xtype: 'fset',
0d4137e0fe36 Added a blank window to edit a Messung
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
70 name: 'messungskommentare',
0d4137e0fe36 Added a blank window to edit a Messung
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
71 title: 'Messungskommentare - Stub'
590
e440b66a859f Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 581
diff changeset
72 // TODO
576
0d4137e0fe36 Added a blank window to edit a Messung
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
73 }]
0d4137e0fe36 Added a blank window to edit a Messung
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
74 }];
0d4137e0fe36 Added a blank window to edit a Messung
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
75 this.callParent(arguments);
0d4137e0fe36 Added a blank window to edit a Messung
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
76 },
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 initData: function() {
0d4137e0fe36 Added a blank window to edit a Messung
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
79 this.clearMessages();
0d4137e0fe36 Added a blank window to edit a Messung
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
80 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
81 failure: function(record) {
e440b66a859f Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 581
diff changeset
82 // TODO
e440b66a859f Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 581
diff changeset
83 console.log(record);
576
0d4137e0fe36 Added a blank window to edit a Messung
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
84 },
590
e440b66a859f Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 581
diff changeset
85 success: function(record, response) {
e440b66a859f Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 581
diff changeset
86 this.down('messungform').setRecord(record);
e440b66a859f Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 581
diff changeset
87 var json = Ext.decode(response.response.responseText);
e440b66a859f Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 581
diff changeset
88 if (json) {
e440b66a859f Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 581
diff changeset
89 this.setMessages(json.errors, json.warnings);
e440b66a859f Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 581
diff changeset
90 }
576
0d4137e0fe36 Added a blank window to edit a Messung
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
91 },
0d4137e0fe36 Added a blank window to edit a Messung
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
92 scope: this
0d4137e0fe36 Added a blank window to edit a Messung
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
93 }
0d4137e0fe36 Added a blank window to edit a Messung
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
94 );
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
0d4137e0fe36 Added a blank window to edit a Messung
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
97 setMessages: function(errors, warnings) {
0d4137e0fe36 Added a blank window to edit a Messung
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
98 //todo this is a stub
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 clearMessages: function() {
0d4137e0fe36 Added a blank window to edit a Messung
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
101 //todo this is a stub
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 });

http://lada.wald.intevation.org