annotate app/view/messungen/List.js @ 164:767300b2c70f

Added custom renderer for "Anzahl Kommentare" column count the number of comments for this messung.
author Torsten Irländer <torsten.irlaender@intevation.de>
date Wed, 03 Jul 2013 14:03:51 +0200
parents 3552b0ee4526
children 202d89d8dd16
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"},
103
3552b0ee4526 Added Messungenlist to the Proben eddit view.
Torsten Irländer <torsten@irlaender.de>
parents:
diff changeset
37 {header: 'Status'},
3552b0ee4526 Added Messungenlist to the Proben eddit view.
Torsten Irländer <torsten@irlaender.de>
parents:
diff changeset
38 {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
39 {
767300b2c70f Added custom renderer for "Anzahl Kommentare" column count the number of
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 103
diff changeset
40 header: 'Anzahl Nuklide',
767300b2c70f Added custom renderer for "Anzahl Kommentare" column count the number of
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 103
diff changeset
41 dataIndex: 'messungsId',
767300b2c70f Added custom renderer for "Anzahl Kommentare" column count the number of
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 103
diff changeset
42 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
43 }
767300b2c70f Added custom renderer for "Anzahl Kommentare" column count the number of
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 103
diff changeset
44 },
767300b2c70f Added custom renderer for "Anzahl Kommentare" column count the number of
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 103
diff changeset
45 {
767300b2c70f Added custom renderer for "Anzahl Kommentare" column count the number of
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 103
diff changeset
46 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
47 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
48 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
49 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
50 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
51 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
52 params: {
767300b2c70f Added custom renderer for "Anzahl Kommentare" column count the number of
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 103
diff changeset
53 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
54 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
55 }
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 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
58 }
767300b2c70f Added custom renderer for "Anzahl Kommentare" column count the number of
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 103
diff changeset
59 }
103
3552b0ee4526 Added Messungenlist to the Proben eddit view.
Torsten Irländer <torsten@irlaender.de>
parents:
diff changeset
60 ];
3552b0ee4526 Added Messungenlist to the Proben eddit view.
Torsten Irländer <torsten@irlaender.de>
parents:
diff changeset
61 this.callParent(arguments);
3552b0ee4526 Added Messungenlist to the Proben eddit view.
Torsten Irländer <torsten@irlaender.de>
parents:
diff changeset
62 }
3552b0ee4526 Added Messungenlist to the Proben eddit view.
Torsten Irländer <torsten@irlaender.de>
parents:
diff changeset
63 });
3552b0ee4526 Added Messungenlist to the Proben eddit view.
Torsten Irländer <torsten@irlaender.de>
parents:
diff changeset
64

http://lada.wald.intevation.org