annotate app/view/messwerte/List.js @ 419:2f4270ff8206

Issue70: Indikator eingefügt um anzuzeigen das der Messert unterhalb der Nachweisgrenze liegt.
author Torsten Irländer <torsten.irlaender@intevation.de>
date Fri, 11 Oct 2013 13:04:30 +0200
parents d1bb925bb5f5
children 3ed0ab0f5ee5
rev   line source
345
c3c64920b740 Added documentation
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 210
diff changeset
1 /*
c3c64920b740 Added documentation
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 210
diff changeset
2 * Grid to list Messwerte
c3c64920b740 Added documentation
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 210
diff changeset
3 */
183
ceb04286152a Added missing file.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
4 Ext.define('Lada.view.messwerte.List' ,{
ceb04286152a Added missing file.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
5 extend: 'Ext.grid.Panel',
ceb04286152a Added missing file.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
6 alias: 'widget.messwertelist',
ceb04286152a Added missing file.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
7 store: 'Messwerte',
ceb04286152a Added missing file.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
8 viewConfig: {
ceb04286152a Added missing file.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
9 maxHeight: 350,
ceb04286152a Added missing file.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
10 emptyText: 'Keine Messwerte gefunden.',
ceb04286152a Added missing file.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
11 // minHeight and deferEmptyText are needed to be able to show the
ceb04286152a Added missing file.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
12 // emptyText message.
ceb04286152a Added missing file.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
13 minHeight: 35,
ceb04286152a Added missing file.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
14 deferEmptyText: false
ceb04286152a Added missing file.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
15 },
ceb04286152a Added missing file.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
16 probeId: null,
210
f3a2f985f451 Set parentId to messwert for add button
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 183
diff changeset
17 parentId: null,
183
ceb04286152a Added missing file.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
18 initComponent: function() {
ceb04286152a Added missing file.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
19 this.dockedItems = [
ceb04286152a Added missing file.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
20 {
ceb04286152a Added missing file.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
21 xtype: 'toolbar',
ceb04286152a Added missing file.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
22 dock: 'top',
ceb04286152a Added missing file.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
23 items: [
ceb04286152a Added missing file.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
24 {
ceb04286152a Added missing file.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
25 text: 'Hinzufügen',
391
d1bb925bb5f5 Use the new icons in list views and status bar.
Raimund Renkert <rrenkert@intevation.de>
parents: 345
diff changeset
26 icon: 'gfx/list-add.png',
183
ceb04286152a Added missing file.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
27 action: 'add',
210
f3a2f985f451 Set parentId to messwert for add button
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 183
diff changeset
28 probeId: this.probeId,
f3a2f985f451 Set parentId to messwert for add button
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 183
diff changeset
29 parentId: this.parentId
183
ceb04286152a Added missing file.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
30 },
ceb04286152a Added missing file.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
31 {
ceb04286152a Added missing file.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
32 text: 'Löschen',
391
d1bb925bb5f5 Use the new icons in list views and status bar.
Raimund Renkert <rrenkert@intevation.de>
parents: 345
diff changeset
33 icon: 'gfx/list-remove.png',
183
ceb04286152a Added missing file.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
34 action: 'delete'
ceb04286152a Added missing file.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
35 }
ceb04286152a Added missing file.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
36 ]
ceb04286152a Added missing file.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
37 }
ceb04286152a Added missing file.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
38 ];
ceb04286152a Added missing file.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
39 this.columns = [
419
2f4270ff8206 Issue70: Indikator eingefügt um anzuzeigen das der Messert unterhalb der
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 391
diff changeset
40 {
2f4270ff8206 Issue70: Indikator eingefügt um anzuzeigen das der Messert unterhalb der
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 391
diff changeset
41 header: 'Messwert',
2f4270ff8206 Issue70: Indikator eingefügt um anzuzeigen das der Messert unterhalb der
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 391
diff changeset
42 dataIndex: 'messwert',
2f4270ff8206 Issue70: Indikator eingefügt um anzuzeigen das der Messert unterhalb der
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 391
diff changeset
43 renderer: function(value, row) {
2f4270ff8206 Issue70: Indikator eingefügt um anzuzeigen das der Messert unterhalb der
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 391
diff changeset
44 // the seconds argument here is not documented in JQuery
2f4270ff8206 Issue70: Indikator eingefügt um anzuzeigen das der Messert unterhalb der
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 391
diff changeset
45 // but it has the current rendererd row and this
2f4270ff8206 Issue70: Indikator eingefügt um anzuzeigen das der Messert unterhalb der
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 391
diff changeset
46 // referenced the record.
2f4270ff8206 Issue70: Indikator eingefügt um anzuzeigen das der Messert unterhalb der
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 391
diff changeset
47 var nwg = row.record.get('nwgZuMesswert');
2f4270ff8206 Issue70: Indikator eingefügt um anzuzeigen das der Messert unterhalb der
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 391
diff changeset
48 if (value < nwg) {
2f4270ff8206 Issue70: Indikator eingefügt um anzuzeigen das der Messert unterhalb der
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 391
diff changeset
49 return "<"+value;
2f4270ff8206 Issue70: Indikator eingefügt um anzuzeigen das der Messert unterhalb der
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 391
diff changeset
50 } else {
2f4270ff8206 Issue70: Indikator eingefügt um anzuzeigen das der Messert unterhalb der
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 391
diff changeset
51 return value;
2f4270ff8206 Issue70: Indikator eingefügt um anzuzeigen das der Messert unterhalb der
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 391
diff changeset
52 }
2f4270ff8206 Issue70: Indikator eingefügt um anzuzeigen das der Messert unterhalb der
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 391
diff changeset
53 }
2f4270ff8206 Issue70: Indikator eingefügt um anzuzeigen das der Messert unterhalb der
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 391
diff changeset
54 },
183
ceb04286152a Added missing file.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
55 {header: 'Messfehler', dataIndex: 'messfehler'},
ceb04286152a Added missing file.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
56 {
ceb04286152a Added missing file.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
57 header: 'Messgröße',
ceb04286152a Added missing file.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
58 dataIndex: 'messgroesseId',
ceb04286152a Added missing file.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
59 renderer: function(value) {
ceb04286152a Added missing file.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
60 var store = Ext.getStore('Messgroessen');
ceb04286152a Added missing file.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
61 return store.findRecord('messgroesseId', value).get('messgro0esse');
ceb04286152a Added missing file.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
62 }
ceb04286152a Added missing file.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
63 },
ceb04286152a Added missing file.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
64 {
ceb04286152a Added missing file.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
65 header: 'Messeinheit',
ceb04286152a Added missing file.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
66 dataIndex: 'mehId',
ceb04286152a Added missing file.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
67 renderer: function(value) {
ceb04286152a Added missing file.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
68 var store = Ext.getStore('Messeinheit');
ceb04286152a Added missing file.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
69 return store.findRecord('mehId', value).get('einheit');
ceb04286152a Added missing file.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
70 }
ceb04286152a Added missing file.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
71 },
ceb04286152a Added missing file.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
72 {
ceb04286152a Added missing file.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
73 header: 'Grenzwertüberschreitung',
ceb04286152a Added missing file.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
74 dataIndex: 'grenzwertueberschreitung',
ceb04286152a Added missing file.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
75 flex: 1,
ceb04286152a Added missing file.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
76 renderer: function(value) {
ceb04286152a Added missing file.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
77 if (value === true) {
ceb04286152a Added missing file.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
78 return "Ja";
ceb04286152a Added missing file.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
79 } else {
ceb04286152a Added missing file.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
80 return "Nein";
ceb04286152a Added missing file.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
81 }
ceb04286152a Added missing file.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
82 }
ceb04286152a Added missing file.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
83 }
ceb04286152a Added missing file.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
84 ];
ceb04286152a Added missing file.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
85 this.callParent(arguments);
ceb04286152a Added missing file.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
86 }
ceb04286152a Added missing file.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
87 });
ceb04286152a Added missing file.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
88

http://lada.wald.intevation.org