annotate app/view/messungen/List.js @ 468:59f8a9a20e44

Added tag 1.0 for changeset fa2a7a37a248
author Torsten Irländer <torsten.irlaender@intevation.de>
date Tue, 14 Jan 2014 12:29:07 +0100
parents 7e73478780fe
children debfcc7713e3
rev   line source
343
eccf58d3b106 Added documentation
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 172
diff changeset
1 /*
eccf58d3b106 Added documentation
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 172
diff changeset
2 * Grid to list Messungen
eccf58d3b106 Added documentation
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 172
diff changeset
3 */
103
3552b0ee4526 Added Messungenlist to the Proben eddit view.
Torsten Irländer <torsten@irlaender.de>
parents:
diff changeset
4 Ext.define('Lada.view.messungen.List' ,{
3552b0ee4526 Added Messungenlist to the Proben eddit view.
Torsten Irländer <torsten@irlaender.de>
parents:
diff changeset
5 extend: 'Ext.grid.Panel',
3552b0ee4526 Added Messungenlist to the Proben eddit view.
Torsten Irländer <torsten@irlaender.de>
parents:
diff changeset
6 alias: 'widget.messungenlist',
3552b0ee4526 Added Messungenlist to the Proben eddit view.
Torsten Irländer <torsten@irlaender.de>
parents:
diff changeset
7 store: 'Messungen',
3552b0ee4526 Added Messungenlist to the Proben eddit view.
Torsten Irländer <torsten@irlaender.de>
parents:
diff changeset
8 viewConfig: {
3552b0ee4526 Added Messungenlist to the Proben eddit view.
Torsten Irländer <torsten@irlaender.de>
parents:
diff changeset
9 maxHeight: 350,
3552b0ee4526 Added Messungenlist to the Proben eddit view.
Torsten Irländer <torsten@irlaender.de>
parents:
diff changeset
10 emptyText: 'Keine Messungen gefunden.',
3552b0ee4526 Added Messungenlist to the Proben eddit view.
Torsten Irländer <torsten@irlaender.de>
parents:
diff changeset
11 // 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
12 // emptyText message.
3552b0ee4526 Added Messungenlist to the Proben eddit view.
Torsten Irländer <torsten@irlaender.de>
parents:
diff changeset
13 minHeight: 35,
3552b0ee4526 Added Messungenlist to the Proben eddit view.
Torsten Irländer <torsten@irlaender.de>
parents:
diff changeset
14 deferEmptyText: false
3552b0ee4526 Added Messungenlist to the Proben eddit view.
Torsten Irländer <torsten@irlaender.de>
parents:
diff changeset
15 },
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
16 probeId: null,
103
3552b0ee4526 Added Messungenlist to the Proben eddit view.
Torsten Irländer <torsten@irlaender.de>
parents:
diff changeset
17 initComponent: function() {
3552b0ee4526 Added Messungenlist to the Proben eddit view.
Torsten Irländer <torsten@irlaender.de>
parents:
diff changeset
18 this.dockedItems = [
3552b0ee4526 Added Messungenlist to the Proben eddit view.
Torsten Irländer <torsten@irlaender.de>
parents:
diff changeset
19 {
3552b0ee4526 Added Messungenlist to the Proben eddit view.
Torsten Irländer <torsten@irlaender.de>
parents:
diff changeset
20 xtype: 'toolbar',
3552b0ee4526 Added Messungenlist to the Proben eddit view.
Torsten Irländer <torsten@irlaender.de>
parents:
diff changeset
21 dock: 'top',
3552b0ee4526 Added Messungenlist to the Proben eddit view.
Torsten Irländer <torsten@irlaender.de>
parents:
diff changeset
22 items: [
3552b0ee4526 Added Messungenlist to the Proben eddit view.
Torsten Irländer <torsten@irlaender.de>
parents:
diff changeset
23 {
3552b0ee4526 Added Messungenlist to the Proben eddit view.
Torsten Irländer <torsten@irlaender.de>
parents:
diff changeset
24 text: 'Hinzufügen',
391
d1bb925bb5f5 Use the new icons in list views and status bar.
Raimund Renkert <rrenkert@intevation.de>
parents: 343
diff changeset
25 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
26 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
27 probeId: this.probeId
103
3552b0ee4526 Added Messungenlist to the Proben eddit view.
Torsten Irländer <torsten@irlaender.de>
parents:
diff changeset
28 },
3552b0ee4526 Added Messungenlist to the Proben eddit view.
Torsten Irländer <torsten@irlaender.de>
parents:
diff changeset
29 {
3552b0ee4526 Added Messungenlist to the Proben eddit view.
Torsten Irländer <torsten@irlaender.de>
parents:
diff changeset
30 text: 'Löschen',
391
d1bb925bb5f5 Use the new icons in list views and status bar.
Raimund Renkert <rrenkert@intevation.de>
parents: 343
diff changeset
31 icon: 'gfx/list-remove.png',
103
3552b0ee4526 Added Messungenlist to the Proben eddit view.
Torsten Irländer <torsten@irlaender.de>
parents:
diff changeset
32 action: 'delete'
3552b0ee4526 Added Messungenlist to the Proben eddit view.
Torsten Irländer <torsten@irlaender.de>
parents:
diff changeset
33 }
3552b0ee4526 Added Messungenlist to the Proben eddit view.
Torsten Irländer <torsten@irlaender.de>
parents:
diff changeset
34 ]
3552b0ee4526 Added Messungenlist to the Proben eddit view.
Torsten Irländer <torsten@irlaender.de>
parents:
diff changeset
35 }
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 this.columns = [
3552b0ee4526 Added Messungenlist to the Proben eddit view.
Torsten Irländer <torsten@irlaender.de>
parents:
diff changeset
38 {header: 'Mess.ID', dataIndex: "messungsId", width: 50},
3552b0ee4526 Added Messungenlist to the Proben eddit view.
Torsten Irländer <torsten@irlaender.de>
parents:
diff changeset
39 {header: 'NPR-Nr.', dataIndex: "nebenprobenNr", width: 50},
3552b0ee4526 Added Messungenlist to the Proben eddit view.
Torsten Irländer <torsten@irlaender.de>
parents:
diff changeset
40 {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
41 {header: 'Messzeit', dataIndex: "messzeitpunkt"},
170
738d657d8b6b Added Status into Messungen listing.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 169
diff changeset
42 {
738d657d8b6b Added Status into Messungen listing.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 169
diff changeset
43 header: 'Status',
738d657d8b6b Added Status into Messungen listing.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 169
diff changeset
44 dataIndex: 'id',
738d657d8b6b Added Status into Messungen listing.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 169
diff changeset
45 renderer: function(value) {
738d657d8b6b Added Status into Messungen listing.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 169
diff changeset
46 var sstore = Ext.getStore('Status');
738d657d8b6b Added Status into Messungen listing.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 169
diff changeset
47 sstore.load({
738d657d8b6b Added Status into Messungen listing.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 169
diff changeset
48 params: {
738d657d8b6b Added Status into Messungen listing.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 169
diff changeset
49 probeId: value.probeId,
738d657d8b6b Added Status into Messungen listing.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 169
diff changeset
50 messungsId: value.messungsId
738d657d8b6b Added Status into Messungen listing.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 169
diff changeset
51 }
738d657d8b6b Added Status into Messungen listing.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 169
diff changeset
52 });
738d657d8b6b Added Status into Messungen listing.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 169
diff changeset
53 if (sstore.getTotalCount() === 0) {
738d657d8b6b Added Status into Messungen listing.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 169
diff changeset
54 return "unbekannt";
738d657d8b6b Added Status into Messungen listing.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 169
diff changeset
55 } else {
738d657d8b6b Added Status into Messungen listing.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 169
diff changeset
56 return sstore.last().get('status');
738d657d8b6b Added Status into Messungen listing.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 169
diff changeset
57 }
738d657d8b6b Added Status into Messungen listing.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 169
diff changeset
58 }
738d657d8b6b Added Status into Messungen listing.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 169
diff changeset
59 },
455
7e73478780fe Issue55: Show "Ja"/"Nein" for Fertig-Flag in Overview.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 391
diff changeset
60 {
7e73478780fe Issue55: Show "Ja"/"Nein" for Fertig-Flag in Overview.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 391
diff changeset
61 header: 'OK-Flag',
7e73478780fe Issue55: Show "Ja"/"Nein" for Fertig-Flag in Overview.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 391
diff changeset
62 dataIndex: "fertig",
7e73478780fe Issue55: Show "Ja"/"Nein" for Fertig-Flag in Overview.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 391
diff changeset
63 renderer: function(value) {
7e73478780fe Issue55: Show "Ja"/"Nein" for Fertig-Flag in Overview.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 391
diff changeset
64 if (value) {
7e73478780fe Issue55: Show "Ja"/"Nein" for Fertig-Flag in Overview.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 391
diff changeset
65 return "Ja";
7e73478780fe Issue55: Show "Ja"/"Nein" for Fertig-Flag in Overview.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 391
diff changeset
66 } else {
7e73478780fe Issue55: Show "Ja"/"Nein" for Fertig-Flag in Overview.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 391
diff changeset
67 return "Nein";
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 }
7e73478780fe Issue55: Show "Ja"/"Nein" for Fertig-Flag in Overview.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 391
diff changeset
70 },
164
767300b2c70f Added custom renderer for "Anzahl Kommentare" column count the number of
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 103
diff changeset
71 {
767300b2c70f Added custom renderer for "Anzahl Kommentare" column count the number of
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 103
diff changeset
72 header: 'Anzahl Nuklide',
166
62a356dc2517 Fixed getting Messwerte.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 165
diff changeset
73 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
74 renderer: function(value) {
169
52d105d4e93f Load Messwerte instead of Messungen
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 166
diff changeset
75 var mstore = Ext.getStore('Messwerte');
165
202d89d8dd16 Show "Anzahl der Nuklide"
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 164
diff changeset
76 mstore.load({
202d89d8dd16 Show "Anzahl der Nuklide"
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 164
diff changeset
77 params: {
202d89d8dd16 Show "Anzahl der Nuklide"
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 164
diff changeset
78 probeId: value.probeId,
202d89d8dd16 Show "Anzahl der Nuklide"
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 164
diff changeset
79 messungsId: value.messungsId
202d89d8dd16 Show "Anzahl der Nuklide"
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 164
diff changeset
80 }
202d89d8dd16 Show "Anzahl der Nuklide"
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 164
diff changeset
81 });
202d89d8dd16 Show "Anzahl der Nuklide"
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 164
diff changeset
82 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
83 }
767300b2c70f Added custom renderer for "Anzahl Kommentare" column count the number of
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 103
diff changeset
84 },
767300b2c70f Added custom renderer for "Anzahl Kommentare" column count the number of
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 103
diff changeset
85 {
767300b2c70f Added custom renderer for "Anzahl Kommentare" column count the number of
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 103
diff changeset
86 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
87 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
88 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
89 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
90 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
91 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
92 params: {
767300b2c70f Added custom renderer for "Anzahl Kommentare" column count the number of
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 103
diff changeset
93 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
94 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
95 }
767300b2c70f Added custom renderer for "Anzahl Kommentare" column count the number of
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 103
diff changeset
96 });
767300b2c70f Added custom renderer for "Anzahl Kommentare" column count the number of
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 103
diff changeset
97 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
98 }
767300b2c70f Added custom renderer for "Anzahl Kommentare" column count the number of
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 103
diff changeset
99 }
103
3552b0ee4526 Added Messungenlist to the Proben eddit view.
Torsten Irländer <torsten@irlaender.de>
parents:
diff changeset
100 ];
3552b0ee4526 Added Messungenlist to the Proben eddit view.
Torsten Irländer <torsten@irlaender.de>
parents:
diff changeset
101 this.callParent(arguments);
3552b0ee4526 Added Messungenlist to the Proben eddit view.
Torsten Irländer <torsten@irlaender.de>
parents:
diff changeset
102 }
3552b0ee4526 Added Messungenlist to the Proben eddit view.
Torsten Irländer <torsten@irlaender.de>
parents:
diff changeset
103 });
3552b0ee4526 Added Messungenlist to the Proben eddit view.
Torsten Irländer <torsten@irlaender.de>
parents:
diff changeset
104

http://lada.wald.intevation.org