Mercurial > lada > lada-client
annotate app/view/messungen/List.js @ 472:debfcc7713e3
Added license header to each file.
author | Torsten Irländer <torsten.irlaender@intevation.de> |
---|---|
date | Thu, 16 Jan 2014 17:34:30 +0100 |
parents | 7e73478780fe |
children | 446e99cfd425 |
rev | line source |
---|---|
472
debfcc7713e3
Added license header to each file.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
455
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:
455
diff
changeset
|
2 * Software engineering by Intevation GmbH |
debfcc7713e3
Added license header to each file.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
455
diff
changeset
|
3 * |
debfcc7713e3
Added license header to each file.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
455
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:
455
diff
changeset
|
5 * and comes with ABSOLUTELY NO WARRANTY! Check out |
debfcc7713e3
Added license header to each file.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
455
diff
changeset
|
6 * the documentation coming with IMIS-Labordaten-Application for details. |
debfcc7713e3
Added license header to each file.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
455
diff
changeset
|
7 */ |
debfcc7713e3
Added license header to each file.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
455
diff
changeset
|
8 |
343
eccf58d3b106
Added documentation
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
172
diff
changeset
|
9 /* |
eccf58d3b106
Added documentation
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
172
diff
changeset
|
10 * Grid to list Messungen |
eccf58d3b106
Added documentation
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
172
diff
changeset
|
11 */ |
103
3552b0ee4526
Added Messungenlist to the Proben eddit view.
Torsten Irländer <torsten@irlaender.de>
parents:
diff
changeset
|
12 Ext.define('Lada.view.messungen.List' ,{ |
3552b0ee4526
Added Messungenlist to the Proben eddit view.
Torsten Irländer <torsten@irlaender.de>
parents:
diff
changeset
|
13 extend: 'Ext.grid.Panel', |
3552b0ee4526
Added Messungenlist to the Proben eddit view.
Torsten Irländer <torsten@irlaender.de>
parents:
diff
changeset
|
14 alias: 'widget.messungenlist', |
3552b0ee4526
Added Messungenlist to the Proben eddit view.
Torsten Irländer <torsten@irlaender.de>
parents:
diff
changeset
|
15 store: 'Messungen', |
3552b0ee4526
Added Messungenlist to the Proben eddit view.
Torsten Irländer <torsten@irlaender.de>
parents:
diff
changeset
|
16 viewConfig: { |
3552b0ee4526
Added Messungenlist to the Proben eddit view.
Torsten Irländer <torsten@irlaender.de>
parents:
diff
changeset
|
17 maxHeight: 350, |
3552b0ee4526
Added Messungenlist to the Proben eddit view.
Torsten Irländer <torsten@irlaender.de>
parents:
diff
changeset
|
18 emptyText: 'Keine Messungen gefunden.', |
3552b0ee4526
Added Messungenlist to the Proben eddit view.
Torsten Irländer <torsten@irlaender.de>
parents:
diff
changeset
|
19 // minHeight and deferEmptyText are needed to be able to show the |
3552b0ee4526
Added Messungenlist to the Proben eddit view.
Torsten Irländer <torsten@irlaender.de>
parents:
diff
changeset
|
20 // emptyText message. |
3552b0ee4526
Added Messungenlist to the Proben eddit view.
Torsten Irländer <torsten@irlaender.de>
parents:
diff
changeset
|
21 minHeight: 35, |
3552b0ee4526
Added Messungenlist to the Proben eddit view.
Torsten Irländer <torsten@irlaender.de>
parents:
diff
changeset
|
22 deferEmptyText: false |
3552b0ee4526
Added Messungenlist to the Proben eddit view.
Torsten Irländer <torsten@irlaender.de>
parents:
diff
changeset
|
23 }, |
172
cfa0cc437781
Implemented opening a new Messungen form when clicking and the "Add Button" on
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
171
diff
changeset
|
24 probeId: null, |
103
3552b0ee4526
Added Messungenlist to the Proben eddit view.
Torsten Irländer <torsten@irlaender.de>
parents:
diff
changeset
|
25 initComponent: function() { |
3552b0ee4526
Added Messungenlist to the Proben eddit view.
Torsten Irländer <torsten@irlaender.de>
parents:
diff
changeset
|
26 this.dockedItems = [ |
3552b0ee4526
Added Messungenlist to the Proben eddit view.
Torsten Irländer <torsten@irlaender.de>
parents:
diff
changeset
|
27 { |
3552b0ee4526
Added Messungenlist to the Proben eddit view.
Torsten Irländer <torsten@irlaender.de>
parents:
diff
changeset
|
28 xtype: 'toolbar', |
3552b0ee4526
Added Messungenlist to the Proben eddit view.
Torsten Irländer <torsten@irlaender.de>
parents:
diff
changeset
|
29 dock: 'top', |
3552b0ee4526
Added Messungenlist to the Proben eddit view.
Torsten Irländer <torsten@irlaender.de>
parents:
diff
changeset
|
30 items: [ |
3552b0ee4526
Added Messungenlist to the Proben eddit view.
Torsten Irländer <torsten@irlaender.de>
parents:
diff
changeset
|
31 { |
3552b0ee4526
Added Messungenlist to the Proben eddit view.
Torsten Irländer <torsten@irlaender.de>
parents:
diff
changeset
|
32 text: 'Hinzufügen', |
391
d1bb925bb5f5
Use the new icons in list views and status bar.
Raimund Renkert <rrenkert@intevation.de>
parents:
343
diff
changeset
|
33 icon: 'gfx/list-add.png', |
172
cfa0cc437781
Implemented opening a new Messungen form when clicking and the "Add Button" on
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
171
diff
changeset
|
34 action: 'add', |
cfa0cc437781
Implemented opening a new Messungen form when clicking and the "Add Button" on
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
171
diff
changeset
|
35 probeId: this.probeId |
103
3552b0ee4526
Added Messungenlist to the Proben eddit view.
Torsten Irländer <torsten@irlaender.de>
parents:
diff
changeset
|
36 }, |
3552b0ee4526
Added Messungenlist to the Proben eddit view.
Torsten Irländer <torsten@irlaender.de>
parents:
diff
changeset
|
37 { |
3552b0ee4526
Added Messungenlist to the Proben eddit view.
Torsten Irländer <torsten@irlaender.de>
parents:
diff
changeset
|
38 text: 'Löschen', |
391
d1bb925bb5f5
Use the new icons in list views and status bar.
Raimund Renkert <rrenkert@intevation.de>
parents:
343
diff
changeset
|
39 icon: 'gfx/list-remove.png', |
103
3552b0ee4526
Added Messungenlist to the Proben eddit view.
Torsten Irländer <torsten@irlaender.de>
parents:
diff
changeset
|
40 action: 'delete' |
3552b0ee4526
Added Messungenlist to the Proben eddit view.
Torsten Irländer <torsten@irlaender.de>
parents:
diff
changeset
|
41 } |
3552b0ee4526
Added Messungenlist to the Proben eddit view.
Torsten Irländer <torsten@irlaender.de>
parents:
diff
changeset
|
42 ] |
3552b0ee4526
Added Messungenlist to the Proben eddit view.
Torsten Irländer <torsten@irlaender.de>
parents:
diff
changeset
|
43 } |
3552b0ee4526
Added Messungenlist to the Proben eddit view.
Torsten Irländer <torsten@irlaender.de>
parents:
diff
changeset
|
44 ]; |
3552b0ee4526
Added Messungenlist to the Proben eddit view.
Torsten Irländer <torsten@irlaender.de>
parents:
diff
changeset
|
45 this.columns = [ |
3552b0ee4526
Added Messungenlist to the Proben eddit view.
Torsten Irländer <torsten@irlaender.de>
parents:
diff
changeset
|
46 {header: 'Mess.ID', dataIndex: "messungsId", width: 50}, |
3552b0ee4526
Added Messungenlist to the Proben eddit view.
Torsten Irländer <torsten@irlaender.de>
parents:
diff
changeset
|
47 {header: 'NPR-Nr.', dataIndex: "nebenprobenNr", width: 50}, |
3552b0ee4526
Added Messungenlist to the Proben eddit view.
Torsten Irländer <torsten@irlaender.de>
parents:
diff
changeset
|
48 {header: 'MMT', dataIndex: "mmtId", width: 50}, |
171
c5422819d7b9
Show messzeitpunkt in messung listing. Convert timestamp to date.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
170
diff
changeset
|
49 {header: 'Messzeit', dataIndex: "messzeitpunkt"}, |
170
738d657d8b6b
Added Status into Messungen listing.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
169
diff
changeset
|
50 { |
738d657d8b6b
Added Status into Messungen listing.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
169
diff
changeset
|
51 header: 'Status', |
738d657d8b6b
Added Status into Messungen listing.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
169
diff
changeset
|
52 dataIndex: 'id', |
738d657d8b6b
Added Status into Messungen listing.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
169
diff
changeset
|
53 renderer: function(value) { |
738d657d8b6b
Added Status into Messungen listing.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
169
diff
changeset
|
54 var sstore = Ext.getStore('Status'); |
738d657d8b6b
Added Status into Messungen listing.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
169
diff
changeset
|
55 sstore.load({ |
738d657d8b6b
Added Status into Messungen listing.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
169
diff
changeset
|
56 params: { |
738d657d8b6b
Added Status into Messungen listing.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
169
diff
changeset
|
57 probeId: value.probeId, |
738d657d8b6b
Added Status into Messungen listing.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
169
diff
changeset
|
58 messungsId: value.messungsId |
738d657d8b6b
Added Status into Messungen listing.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
169
diff
changeset
|
59 } |
738d657d8b6b
Added Status into Messungen listing.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
169
diff
changeset
|
60 }); |
738d657d8b6b
Added Status into Messungen listing.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
169
diff
changeset
|
61 if (sstore.getTotalCount() === 0) { |
738d657d8b6b
Added Status into Messungen listing.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
169
diff
changeset
|
62 return "unbekannt"; |
738d657d8b6b
Added Status into Messungen listing.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
169
diff
changeset
|
63 } else { |
738d657d8b6b
Added Status into Messungen listing.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
169
diff
changeset
|
64 return sstore.last().get('status'); |
738d657d8b6b
Added Status into Messungen listing.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
169
diff
changeset
|
65 } |
738d657d8b6b
Added Status into Messungen listing.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
169
diff
changeset
|
66 } |
738d657d8b6b
Added Status into Messungen listing.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
169
diff
changeset
|
67 }, |
455
7e73478780fe
Issue55: Show "Ja"/"Nein" for Fertig-Flag in Overview.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
391
diff
changeset
|
68 { |
7e73478780fe
Issue55: Show "Ja"/"Nein" for Fertig-Flag in Overview.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
391
diff
changeset
|
69 header: 'OK-Flag', |
7e73478780fe
Issue55: Show "Ja"/"Nein" for Fertig-Flag in Overview.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
391
diff
changeset
|
70 dataIndex: "fertig", |
7e73478780fe
Issue55: Show "Ja"/"Nein" for Fertig-Flag in Overview.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
391
diff
changeset
|
71 renderer: function(value) { |
7e73478780fe
Issue55: Show "Ja"/"Nein" for Fertig-Flag in Overview.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
391
diff
changeset
|
72 if (value) { |
7e73478780fe
Issue55: Show "Ja"/"Nein" for Fertig-Flag in Overview.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
391
diff
changeset
|
73 return "Ja"; |
7e73478780fe
Issue55: Show "Ja"/"Nein" for Fertig-Flag in Overview.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
391
diff
changeset
|
74 } else { |
7e73478780fe
Issue55: Show "Ja"/"Nein" for Fertig-Flag in Overview.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
391
diff
changeset
|
75 return "Nein"; |
7e73478780fe
Issue55: Show "Ja"/"Nein" for Fertig-Flag in Overview.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
391
diff
changeset
|
76 } |
7e73478780fe
Issue55: Show "Ja"/"Nein" for Fertig-Flag in Overview.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
391
diff
changeset
|
77 } |
7e73478780fe
Issue55: Show "Ja"/"Nein" for Fertig-Flag in Overview.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
391
diff
changeset
|
78 }, |
164
767300b2c70f
Added custom renderer for "Anzahl Kommentare" column count the number of
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
103
diff
changeset
|
79 { |
767300b2c70f
Added custom renderer for "Anzahl Kommentare" column count the number of
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
103
diff
changeset
|
80 header: 'Anzahl Nuklide', |
166
62a356dc2517
Fixed getting Messwerte.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
165
diff
changeset
|
81 dataIndex: 'id', |
164
767300b2c70f
Added custom renderer for "Anzahl Kommentare" column count the number of
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
103
diff
changeset
|
82 renderer: function(value) { |
169
52d105d4e93f
Load Messwerte instead of Messungen
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
166
diff
changeset
|
83 var mstore = Ext.getStore('Messwerte'); |
165
202d89d8dd16
Show "Anzahl der Nuklide"
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
164
diff
changeset
|
84 mstore.load({ |
202d89d8dd16
Show "Anzahl der Nuklide"
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
164
diff
changeset
|
85 params: { |
202d89d8dd16
Show "Anzahl der Nuklide"
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
164
diff
changeset
|
86 probeId: value.probeId, |
202d89d8dd16
Show "Anzahl der Nuklide"
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
164
diff
changeset
|
87 messungsId: value.messungsId |
202d89d8dd16
Show "Anzahl der Nuklide"
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
164
diff
changeset
|
88 } |
202d89d8dd16
Show "Anzahl der Nuklide"
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
164
diff
changeset
|
89 }); |
202d89d8dd16
Show "Anzahl der Nuklide"
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
164
diff
changeset
|
90 return mstore.getTotalCount(); |
164
767300b2c70f
Added custom renderer for "Anzahl Kommentare" column count the number of
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
103
diff
changeset
|
91 } |
767300b2c70f
Added custom renderer for "Anzahl Kommentare" column count the number of
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
103
diff
changeset
|
92 }, |
767300b2c70f
Added custom renderer for "Anzahl Kommentare" column count the number of
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
103
diff
changeset
|
93 { |
767300b2c70f
Added custom renderer for "Anzahl Kommentare" column count the number of
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
103
diff
changeset
|
94 header: 'Anzahl Kommentare', |
767300b2c70f
Added custom renderer for "Anzahl Kommentare" column count the number of
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
103
diff
changeset
|
95 flex: 1, |
767300b2c70f
Added custom renderer for "Anzahl Kommentare" column count the number of
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
103
diff
changeset
|
96 dataIndex: 'id', |
767300b2c70f
Added custom renderer for "Anzahl Kommentare" column count the number of
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
103
diff
changeset
|
97 renderer: function(value) { |
767300b2c70f
Added custom renderer for "Anzahl Kommentare" column count the number of
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
103
diff
changeset
|
98 var kstore = Ext.getStore('MKommentare'); |
767300b2c70f
Added custom renderer for "Anzahl Kommentare" column count the number of
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
103
diff
changeset
|
99 kstore.load({ |
767300b2c70f
Added custom renderer for "Anzahl Kommentare" column count the number of
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
103
diff
changeset
|
100 params: { |
767300b2c70f
Added custom renderer for "Anzahl Kommentare" column count the number of
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
103
diff
changeset
|
101 probeId: value.probeId, |
767300b2c70f
Added custom renderer for "Anzahl Kommentare" column count the number of
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
103
diff
changeset
|
102 messungsId: value.messungsId |
767300b2c70f
Added custom renderer for "Anzahl Kommentare" column count the number of
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
103
diff
changeset
|
103 } |
767300b2c70f
Added custom renderer for "Anzahl Kommentare" column count the number of
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
103
diff
changeset
|
104 }); |
767300b2c70f
Added custom renderer for "Anzahl Kommentare" column count the number of
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
103
diff
changeset
|
105 return kstore.getTotalCount(); |
767300b2c70f
Added custom renderer for "Anzahl Kommentare" column count the number of
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
103
diff
changeset
|
106 } |
767300b2c70f
Added custom renderer for "Anzahl Kommentare" column count the number of
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
103
diff
changeset
|
107 } |
103
3552b0ee4526
Added Messungenlist to the Proben eddit view.
Torsten Irländer <torsten@irlaender.de>
parents:
diff
changeset
|
108 ]; |
3552b0ee4526
Added Messungenlist to the Proben eddit view.
Torsten Irländer <torsten@irlaender.de>
parents:
diff
changeset
|
109 this.callParent(arguments); |
3552b0ee4526
Added Messungenlist to the Proben eddit view.
Torsten Irländer <torsten@irlaender.de>
parents:
diff
changeset
|
110 } |
3552b0ee4526
Added Messungenlist to the Proben eddit view.
Torsten Irländer <torsten@irlaender.de>
parents:
diff
changeset
|
111 }); |
3552b0ee4526
Added Messungenlist to the Proben eddit view.
Torsten Irländer <torsten@irlaender.de>
parents:
diff
changeset
|
112 |