annotate app/view/messwerte/List.js @ 490:446e99cfd425

Updated views and controllers using the new model and stores.
author Raimund Renkert <raimund.renkert@intevation.de>
date Fri, 31 Oct 2014 21:28:31 +0100
parents debfcc7713e3
children 850ccfe5f3c4
rev   line source
472
debfcc7713e3 Added license header to each file.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 445
diff changeset
1 /* Copyright (C) 2013 by Bundesamt fuer Strahlenschutz
debfcc7713e3 Added license header to each file.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 445
diff changeset
2 * Software engineering by Intevation GmbH
debfcc7713e3 Added license header to each file.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 445
diff changeset
3 *
debfcc7713e3 Added license header to each file.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 445
diff changeset
4 * This file is Free Software under the GNU GPL (v>=3)
debfcc7713e3 Added license header to each file.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 445
diff changeset
5 * and comes with ABSOLUTELY NO WARRANTY! Check out
debfcc7713e3 Added license header to each file.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 445
diff changeset
6 * the documentation coming with IMIS-Labordaten-Application for details.
debfcc7713e3 Added license header to each file.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 445
diff changeset
7 */
debfcc7713e3 Added license header to each file.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 445
diff changeset
8
345
c3c64920b740 Added documentation
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 210
diff changeset
9 /*
c3c64920b740 Added documentation
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 210
diff changeset
10 * Grid to list Messwerte
c3c64920b740 Added documentation
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 210
diff changeset
11 */
183
ceb04286152a Added missing file.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
12 Ext.define('Lada.view.messwerte.List' ,{
ceb04286152a Added missing file.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
13 extend: 'Ext.grid.Panel',
490
446e99cfd425 Updated views and controllers using the new model and stores.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 472
diff changeset
14 require: ['Lada.store.StaMesseinheit'],
183
ceb04286152a Added missing file.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
15 alias: 'widget.messwertelist',
ceb04286152a Added missing file.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
16 store: 'Messwerte',
ceb04286152a Added missing file.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
17 viewConfig: {
ceb04286152a Added missing file.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
18 maxHeight: 350,
ceb04286152a Added missing file.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
19 emptyText: 'Keine Messwerte gefunden.',
ceb04286152a Added missing file.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
20 // 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
21 // emptyText message.
ceb04286152a Added missing file.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
22 minHeight: 35,
ceb04286152a Added missing file.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
23 deferEmptyText: false
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 probeId: null,
210
f3a2f985f451 Set parentId to messwert for add button
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 183
diff changeset
26 parentId: null,
183
ceb04286152a Added missing file.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
27 initComponent: function() {
ceb04286152a Added missing file.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
28 this.dockedItems = [
ceb04286152a Added missing file.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
29 {
ceb04286152a Added missing file.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
30 xtype: 'toolbar',
ceb04286152a Added missing file.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
31 dock: 'top',
ceb04286152a Added missing file.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
32 items: [
ceb04286152a Added missing file.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
33 {
ceb04286152a Added missing file.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
34 text: 'Hinzufügen',
391
d1bb925bb5f5 Use the new icons in list views and status bar.
Raimund Renkert <rrenkert@intevation.de>
parents: 345
diff changeset
35 icon: 'gfx/list-add.png',
183
ceb04286152a Added missing file.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
36 action: 'add',
210
f3a2f985f451 Set parentId to messwert for add button
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 183
diff changeset
37 probeId: this.probeId,
f3a2f985f451 Set parentId to messwert for add button
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 183
diff changeset
38 parentId: this.parentId
183
ceb04286152a Added missing file.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
39 },
ceb04286152a Added missing file.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
40 {
ceb04286152a Added missing file.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
41 text: 'Löschen',
391
d1bb925bb5f5 Use the new icons in list views and status bar.
Raimund Renkert <rrenkert@intevation.de>
parents: 345
diff changeset
42 icon: 'gfx/list-remove.png',
183
ceb04286152a Added missing file.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
43 action: 'delete'
ceb04286152a Added missing file.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
44 }
ceb04286152a Added missing file.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
45 ]
ceb04286152a Added missing file.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
46 }
ceb04286152a Added missing file.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
47 ];
ceb04286152a Added missing file.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
48 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
49 {
437
3ed0ab0f5ee5 Issue70: Neue Spalte zum Anzeigen ob der Messwert < als die NWG ist. Wenn MW <
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 419
diff changeset
50 header: '&lt;NWG',
442
bba7fbcf2f70 Simplified logic in Messwert listing. No extra logic anymore to check if a "<"
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 437
diff changeset
51 dataIndex: 'messwertNwg'
437
3ed0ab0f5ee5 Issue70: Neue Spalte zum Anzeigen ob der Messwert < als die NWG ist. Wenn MW <
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 419
diff changeset
52 },
3ed0ab0f5ee5 Issue70: Neue Spalte zum Anzeigen ob der Messwert < als die NWG ist. Wenn MW <
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 419
diff changeset
53 {
419
2f4270ff8206 Issue70: Indikator eingefügt um anzuzeigen das der Messert unterhalb der
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 391
diff changeset
54 header: 'Messwert',
442
bba7fbcf2f70 Simplified logic in Messwert listing. No extra logic anymore to check if a "<"
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 437
diff changeset
55 dataIndex: 'messwert'
419
2f4270ff8206 Issue70: Indikator eingefügt um anzuzeigen das der Messert unterhalb der
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 391
diff changeset
56 },
183
ceb04286152a Added missing file.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
57 {header: 'Messfehler', dataIndex: 'messfehler'},
ceb04286152a Added missing file.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
58 {
ceb04286152a Added missing file.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
59 header: 'Messgröße',
ceb04286152a Added missing file.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
60 dataIndex: 'messgroesseId',
ceb04286152a Added missing file.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
61 renderer: function(value) {
490
446e99cfd425 Updated views and controllers using the new model and stores.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 472
diff changeset
62 var store = Ext.getStore('StaMessgroessen');
446e99cfd425 Updated views and controllers using the new model and stores.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 472
diff changeset
63 return store.findRecord('id', value).get('messgroesse');
183
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 },
ceb04286152a Added missing file.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
66 {
ceb04286152a Added missing file.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
67 header: 'Messeinheit',
ceb04286152a Added missing file.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
68 dataIndex: 'mehId',
ceb04286152a Added missing file.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
69 renderer: function(value) {
490
446e99cfd425 Updated views and controllers using the new model and stores.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 472
diff changeset
70 console.log('einheit: ' + value);
446e99cfd425 Updated views and controllers using the new model and stores.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 472
diff changeset
71 var store = Ext.data.StoreManager.get('StaMesseinheiten');
446e99cfd425 Updated views and controllers using the new model and stores.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 472
diff changeset
72 /* if (!store) {
446e99cfd425 Updated views and controllers using the new model and stores.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 472
diff changeset
73 store = Ext.create('Lada.store.StaMesseinheiten');
446e99cfd425 Updated views and controllers using the new model and stores.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 472
diff changeset
74 }
446e99cfd425 Updated views and controllers using the new model and stores.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 472
diff changeset
75 */ console.log(store.getById(value));
446e99cfd425 Updated views and controllers using the new model and stores.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 472
diff changeset
76 return store.findRecord('id', value).get('einheit');
183
ceb04286152a Added missing file.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
77 }
ceb04286152a Added missing file.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
78 },
ceb04286152a Added missing file.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
79 {
ceb04286152a Added missing file.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
80 header: 'Grenzwertüberschreitung',
ceb04286152a Added missing file.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
81 dataIndex: 'grenzwertueberschreitung',
ceb04286152a Added missing file.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
82 flex: 1,
ceb04286152a Added missing file.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
83 renderer: function(value) {
ceb04286152a Added missing file.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
84 if (value === true) {
ceb04286152a Added missing file.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
85 return "Ja";
ceb04286152a Added missing file.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
86 } else {
ceb04286152a Added missing file.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
87 return "Nein";
ceb04286152a Added missing file.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
88 }
ceb04286152a Added missing file.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
89 }
ceb04286152a Added missing file.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
90 }
ceb04286152a Added missing file.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
91 ];
ceb04286152a Added missing file.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
92 this.callParent(arguments);
ceb04286152a Added missing file.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
93 }
ceb04286152a Added missing file.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
94 });
ceb04286152a Added missing file.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
95

http://lada.wald.intevation.org