Mercurial > lada > lada-client
annotate app/view/messungen/List.js @ 360:302db31ac50a
Fixed syntax
author | Torsten Irländer <torsten.irlaender@intevation.de> |
---|---|
date | Thu, 15 Aug 2013 14:04:25 +0200 |
parents | eccf58d3b106 |
children | d1bb925bb5f5 |
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', |
3552b0ee4526
Added Messungenlist to the Proben eddit view.
Torsten Irländer <torsten@irlaender.de>
parents:
diff
changeset
|
25 icon: 'gfx/plus.gif', |
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', |
3552b0ee4526
Added Messungenlist to the Proben eddit view.
Torsten Irländer <torsten@irlaender.de>
parents:
diff
changeset
|
31 icon: 'gfx/minus.gif', |
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 }, |
103
3552b0ee4526
Added Messungenlist to the Proben eddit view.
Torsten Irländer <torsten@irlaender.de>
parents:
diff
changeset
|
60 {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
|
61 { |
767300b2c70f
Added custom renderer for "Anzahl Kommentare" column count the number of
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
103
diff
changeset
|
62 header: 'Anzahl Nuklide', |
166
62a356dc2517
Fixed getting Messwerte.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
165
diff
changeset
|
63 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
|
64 renderer: function(value) { |
169
52d105d4e93f
Load Messwerte instead of Messungen
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
166
diff
changeset
|
65 var mstore = Ext.getStore('Messwerte'); |
165
202d89d8dd16
Show "Anzahl der Nuklide"
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
164
diff
changeset
|
66 mstore.load({ |
202d89d8dd16
Show "Anzahl der Nuklide"
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
164
diff
changeset
|
67 params: { |
202d89d8dd16
Show "Anzahl der Nuklide"
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
164
diff
changeset
|
68 probeId: value.probeId, |
202d89d8dd16
Show "Anzahl der Nuklide"
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
164
diff
changeset
|
69 messungsId: value.messungsId |
202d89d8dd16
Show "Anzahl der Nuklide"
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
164
diff
changeset
|
70 } |
202d89d8dd16
Show "Anzahl der Nuklide"
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
164
diff
changeset
|
71 }); |
202d89d8dd16
Show "Anzahl der Nuklide"
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
164
diff
changeset
|
72 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
|
73 } |
767300b2c70f
Added custom renderer for "Anzahl Kommentare" column count the number of
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
103
diff
changeset
|
74 }, |
767300b2c70f
Added custom renderer for "Anzahl Kommentare" column count the number of
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
103
diff
changeset
|
75 { |
767300b2c70f
Added custom renderer for "Anzahl Kommentare" column count the number of
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
103
diff
changeset
|
76 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
|
77 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
|
78 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
|
79 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
|
80 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
|
81 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
|
82 params: { |
767300b2c70f
Added custom renderer for "Anzahl Kommentare" column count the number of
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
103
diff
changeset
|
83 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
|
84 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
|
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 }); |
767300b2c70f
Added custom renderer for "Anzahl Kommentare" column count the number of
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
103
diff
changeset
|
87 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
|
88 } |
767300b2c70f
Added custom renderer for "Anzahl Kommentare" column count the number of
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
103
diff
changeset
|
89 } |
103
3552b0ee4526
Added Messungenlist to the Proben eddit view.
Torsten Irländer <torsten@irlaender.de>
parents:
diff
changeset
|
90 ]; |
3552b0ee4526
Added Messungenlist to the Proben eddit view.
Torsten Irländer <torsten@irlaender.de>
parents:
diff
changeset
|
91 this.callParent(arguments); |
3552b0ee4526
Added Messungenlist to the Proben eddit view.
Torsten Irländer <torsten@irlaender.de>
parents:
diff
changeset
|
92 } |
3552b0ee4526
Added Messungenlist to the Proben eddit view.
Torsten Irländer <torsten@irlaender.de>
parents:
diff
changeset
|
93 }); |
3552b0ee4526
Added Messungenlist to the Proben eddit view.
Torsten Irländer <torsten@irlaender.de>
parents:
diff
changeset
|
94 |