annotate app/view/messungen/List.js @ 170:738d657d8b6b

Added Status into Messungen listing.
author Torsten Irländer <torsten.irlaender@intevation.de>
date Wed, 03 Jul 2013 16:08:22 +0200
parents 52d105d4e93f
children c5422819d7b9
rev   line source
103
3552b0ee4526 Added Messungenlist to the Proben eddit view.
Torsten Irländer <torsten@irlaender.de>
parents:
diff changeset
1 Ext.define('Lada.view.messungen.List' ,{
3552b0ee4526 Added Messungenlist to the Proben eddit view.
Torsten Irländer <torsten@irlaender.de>
parents:
diff changeset
2 extend: 'Ext.grid.Panel',
3552b0ee4526 Added Messungenlist to the Proben eddit view.
Torsten Irländer <torsten@irlaender.de>
parents:
diff changeset
3 alias: 'widget.messungenlist',
3552b0ee4526 Added Messungenlist to the Proben eddit view.
Torsten Irländer <torsten@irlaender.de>
parents:
diff changeset
4 store: 'Messungen',
3552b0ee4526 Added Messungenlist to the Proben eddit view.
Torsten Irländer <torsten@irlaender.de>
parents:
diff changeset
5 viewConfig: {
3552b0ee4526 Added Messungenlist to the Proben eddit view.
Torsten Irländer <torsten@irlaender.de>
parents:
diff changeset
6 maxHeight: 350,
3552b0ee4526 Added Messungenlist to the Proben eddit view.
Torsten Irländer <torsten@irlaender.de>
parents:
diff changeset
7 emptyText: 'Keine Messungen gefunden.',
3552b0ee4526 Added Messungenlist to the Proben eddit view.
Torsten Irländer <torsten@irlaender.de>
parents:
diff changeset
8 // 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
9 // emptyText message.
3552b0ee4526 Added Messungenlist to the Proben eddit view.
Torsten Irländer <torsten@irlaender.de>
parents:
diff changeset
10 minHeight: 35,
3552b0ee4526 Added Messungenlist to the Proben eddit view.
Torsten Irländer <torsten@irlaender.de>
parents:
diff changeset
11 deferEmptyText: false
3552b0ee4526 Added Messungenlist to the Proben eddit view.
Torsten Irländer <torsten@irlaender.de>
parents:
diff changeset
12 },
3552b0ee4526 Added Messungenlist to the Proben eddit view.
Torsten Irländer <torsten@irlaender.de>
parents:
diff changeset
13 initComponent: function() {
3552b0ee4526 Added Messungenlist to the Proben eddit view.
Torsten Irländer <torsten@irlaender.de>
parents:
diff changeset
14 this.dockedItems = [
3552b0ee4526 Added Messungenlist to the Proben eddit view.
Torsten Irländer <torsten@irlaender.de>
parents:
diff changeset
15 {
3552b0ee4526 Added Messungenlist to the Proben eddit view.
Torsten Irländer <torsten@irlaender.de>
parents:
diff changeset
16 xtype: 'toolbar',
3552b0ee4526 Added Messungenlist to the Proben eddit view.
Torsten Irländer <torsten@irlaender.de>
parents:
diff changeset
17 dock: 'top',
3552b0ee4526 Added Messungenlist to the Proben eddit view.
Torsten Irländer <torsten@irlaender.de>
parents:
diff changeset
18 items: [
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 text: 'Hinzufügen',
3552b0ee4526 Added Messungenlist to the Proben eddit view.
Torsten Irländer <torsten@irlaender.de>
parents:
diff changeset
21 icon: 'gfx/plus.gif',
3552b0ee4526 Added Messungenlist to the Proben eddit view.
Torsten Irländer <torsten@irlaender.de>
parents:
diff changeset
22 action: 'add'
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 {
3552b0ee4526 Added Messungenlist to the Proben eddit view.
Torsten Irländer <torsten@irlaender.de>
parents:
diff changeset
25 text: 'Löschen',
3552b0ee4526 Added Messungenlist to the Proben eddit view.
Torsten Irländer <torsten@irlaender.de>
parents:
diff changeset
26 icon: 'gfx/minus.gif',
3552b0ee4526 Added Messungenlist to the Proben eddit view.
Torsten Irländer <torsten@irlaender.de>
parents:
diff changeset
27 action: 'delete'
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 }
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 this.columns = [
3552b0ee4526 Added Messungenlist to the Proben eddit view.
Torsten Irländer <torsten@irlaender.de>
parents:
diff changeset
33 {header: 'Mess.ID', dataIndex: "messungsId", width: 50},
3552b0ee4526 Added Messungenlist to the Proben eddit view.
Torsten Irländer <torsten@irlaender.de>
parents:
diff changeset
34 {header: 'NPR-Nr.', dataIndex: "nebenprobenNr", width: 50},
3552b0ee4526 Added Messungenlist to the Proben eddit view.
Torsten Irländer <torsten@irlaender.de>
parents:
diff changeset
35 {header: 'MMT', dataIndex: "mmtId", width: 50},
164
767300b2c70f Added custom renderer for "Anzahl Kommentare" column count the number of
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 103
diff changeset
36 {header: 'Messzeit', dataIndex: "messdauer"},
170
738d657d8b6b Added Status into Messungen listing.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 169
diff changeset
37 {
738d657d8b6b Added Status into Messungen listing.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 169
diff changeset
38 header: 'Status',
738d657d8b6b Added Status into Messungen listing.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 169
diff changeset
39 dataIndex: 'id',
738d657d8b6b Added Status into Messungen listing.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 169
diff changeset
40 renderer: function(value) {
738d657d8b6b Added Status into Messungen listing.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 169
diff changeset
41 var sstore = Ext.getStore('Status');
738d657d8b6b Added Status into Messungen listing.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 169
diff changeset
42 sstore.load({
738d657d8b6b Added Status into Messungen listing.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 169
diff changeset
43 params: {
738d657d8b6b Added Status into Messungen listing.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 169
diff changeset
44 probeId: value.probeId,
738d657d8b6b Added Status into Messungen listing.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 169
diff changeset
45 messungsId: value.messungsId
738d657d8b6b Added Status into Messungen listing.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 169
diff changeset
46 }
738d657d8b6b Added Status into Messungen listing.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 169
diff changeset
47 });
738d657d8b6b Added Status into Messungen listing.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 169
diff changeset
48 if (sstore.getTotalCount() === 0) {
738d657d8b6b Added Status into Messungen listing.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 169
diff changeset
49 return "unbekannt";
738d657d8b6b Added Status into Messungen listing.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 169
diff changeset
50 } else {
738d657d8b6b Added Status into Messungen listing.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 169
diff changeset
51 return sstore.last().get('status');
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 }
738d657d8b6b Added Status into Messungen listing.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 169
diff changeset
54 },
103
3552b0ee4526 Added Messungenlist to the Proben eddit view.
Torsten Irländer <torsten@irlaender.de>
parents:
diff changeset
55 {header: 'OK-Flag', dataIndex: "fertig"},
164
767300b2c70f Added custom renderer for "Anzahl Kommentare" column count the number of
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 103
diff changeset
56 {
767300b2c70f Added custom renderer for "Anzahl Kommentare" column count the number of
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 103
diff changeset
57 header: 'Anzahl Nuklide',
166
62a356dc2517 Fixed getting Messwerte.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 165
diff changeset
58 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
59 renderer: function(value) {
169
52d105d4e93f Load Messwerte instead of Messungen
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 166
diff changeset
60 var mstore = Ext.getStore('Messwerte');
165
202d89d8dd16 Show "Anzahl der Nuklide"
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 164
diff changeset
61 mstore.load({
202d89d8dd16 Show "Anzahl der Nuklide"
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 164
diff changeset
62 params: {
202d89d8dd16 Show "Anzahl der Nuklide"
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 164
diff changeset
63 probeId: value.probeId,
202d89d8dd16 Show "Anzahl der Nuklide"
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 164
diff changeset
64 messungsId: value.messungsId
202d89d8dd16 Show "Anzahl der Nuklide"
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 164
diff changeset
65 }
202d89d8dd16 Show "Anzahl der Nuklide"
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 164
diff changeset
66 });
202d89d8dd16 Show "Anzahl der Nuklide"
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 164
diff changeset
67 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
68 }
767300b2c70f Added custom renderer for "Anzahl Kommentare" column count the number of
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 103
diff changeset
69 },
767300b2c70f Added custom renderer for "Anzahl Kommentare" column count the number of
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 103
diff changeset
70 {
767300b2c70f Added custom renderer for "Anzahl Kommentare" column count the number of
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 103
diff changeset
71 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
72 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
73 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
74 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
75 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
76 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
77 params: {
767300b2c70f Added custom renderer for "Anzahl Kommentare" column count the number of
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 103
diff changeset
78 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
79 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
80 }
767300b2c70f Added custom renderer for "Anzahl Kommentare" column count the number of
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 103
diff changeset
81 });
767300b2c70f Added custom renderer for "Anzahl Kommentare" column count the number of
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 103
diff changeset
82 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
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 }
103
3552b0ee4526 Added Messungenlist to the Proben eddit view.
Torsten Irländer <torsten@irlaender.de>
parents:
diff changeset
85 ];
3552b0ee4526 Added Messungenlist to the Proben eddit view.
Torsten Irländer <torsten@irlaender.de>
parents:
diff changeset
86 this.callParent(arguments);
3552b0ee4526 Added Messungenlist to the Proben eddit view.
Torsten Irländer <torsten@irlaender.de>
parents:
diff changeset
87 }
3552b0ee4526 Added Messungenlist to the Proben eddit view.
Torsten Irländer <torsten@irlaender.de>
parents:
diff changeset
88 });
3552b0ee4526 Added Messungenlist to the Proben eddit view.
Torsten Irländer <torsten@irlaender.de>
parents:
diff changeset
89

http://lada.wald.intevation.org