Mercurial > lada > lada-client
annotate app/view/messwerte/List.js @ 493:9fec6df13be8
Fixed the controller.
author | Raimund Renkert <raimund.renkert@intevation.de> |
---|---|
date | Sat, 01 Nov 2014 13:12:37 +0100 |
parents | 850ccfe5f3c4 |
children | d07e5086a64b |
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', |
491
850ccfe5f3c4
Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
490
diff
changeset
|
16 |
183
ceb04286152a
Added missing file.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff
changeset
|
17 store: 'Messwerte', |
ceb04286152a
Added missing file.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff
changeset
|
18 viewConfig: { |
ceb04286152a
Added missing file.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff
changeset
|
19 maxHeight: 350, |
ceb04286152a
Added missing file.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff
changeset
|
20 emptyText: 'Keine Messwerte gefunden.', |
ceb04286152a
Added missing file.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff
changeset
|
21 // 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
|
22 // emptyText message. |
ceb04286152a
Added missing file.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff
changeset
|
23 minHeight: 35, |
ceb04286152a
Added missing file.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff
changeset
|
24 deferEmptyText: false |
ceb04286152a
Added missing file.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff
changeset
|
25 }, |
491
850ccfe5f3c4
Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
490
diff
changeset
|
26 |
183
ceb04286152a
Added missing file.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff
changeset
|
27 probeId: null, |
210
f3a2f985f451
Set parentId to messwert for add button
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
183
diff
changeset
|
28 parentId: null, |
491
850ccfe5f3c4
Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
490
diff
changeset
|
29 |
183
ceb04286152a
Added missing file.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff
changeset
|
30 initComponent: function() { |
491
850ccfe5f3c4
Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
490
diff
changeset
|
31 this.dockedItems = [{ |
850ccfe5f3c4
Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
490
diff
changeset
|
32 xtype: 'toolbar', |
850ccfe5f3c4
Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
490
diff
changeset
|
33 dock: 'top', |
850ccfe5f3c4
Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
490
diff
changeset
|
34 items: [{ |
850ccfe5f3c4
Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
490
diff
changeset
|
35 text: 'Hinzufügen', |
850ccfe5f3c4
Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
490
diff
changeset
|
36 icon: 'gfx/list-add.png', |
850ccfe5f3c4
Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
490
diff
changeset
|
37 action: 'add', |
850ccfe5f3c4
Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
490
diff
changeset
|
38 probeId: this.probeId, |
850ccfe5f3c4
Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
490
diff
changeset
|
39 parentId: this.parentId |
850ccfe5f3c4
Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
490
diff
changeset
|
40 }, { |
850ccfe5f3c4
Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
490
diff
changeset
|
41 text: 'Löschen', |
850ccfe5f3c4
Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
490
diff
changeset
|
42 icon: 'gfx/list-remove.png', |
850ccfe5f3c4
Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
490
diff
changeset
|
43 action: 'delete' |
850ccfe5f3c4
Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
490
diff
changeset
|
44 }] |
850ccfe5f3c4
Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
490
diff
changeset
|
45 }]; |
850ccfe5f3c4
Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
490
diff
changeset
|
46 this.columns = [{ |
850ccfe5f3c4
Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
490
diff
changeset
|
47 header: '<NWG', |
850ccfe5f3c4
Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
490
diff
changeset
|
48 dataIndex: 'messwertNwg' |
850ccfe5f3c4
Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
490
diff
changeset
|
49 }, { |
850ccfe5f3c4
Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
490
diff
changeset
|
50 header: 'Messwert', |
850ccfe5f3c4
Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
490
diff
changeset
|
51 dataIndex: 'messwert' |
850ccfe5f3c4
Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
490
diff
changeset
|
52 }, { |
850ccfe5f3c4
Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
490
diff
changeset
|
53 header: 'Messfehler', |
850ccfe5f3c4
Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
490
diff
changeset
|
54 dataIndex: 'messfehler' |
850ccfe5f3c4
Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
490
diff
changeset
|
55 }, { |
850ccfe5f3c4
Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
490
diff
changeset
|
56 header: 'Messgröße', |
850ccfe5f3c4
Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
490
diff
changeset
|
57 dataIndex: 'messgroesseId', |
850ccfe5f3c4
Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
490
diff
changeset
|
58 renderer: function(value) { |
850ccfe5f3c4
Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
490
diff
changeset
|
59 var store = Ext.getStore('StaMessgroessen'); |
850ccfe5f3c4
Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
490
diff
changeset
|
60 return store.findRecord('id', value).get('messgroesse'); |
183
ceb04286152a
Added missing file.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff
changeset
|
61 } |
491
850ccfe5f3c4
Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
490
diff
changeset
|
62 }, { |
850ccfe5f3c4
Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
490
diff
changeset
|
63 header: 'Messeinheit', |
850ccfe5f3c4
Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
490
diff
changeset
|
64 dataIndex: 'mehId', |
850ccfe5f3c4
Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
490
diff
changeset
|
65 renderer: function(value) { |
850ccfe5f3c4
Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
490
diff
changeset
|
66 console.log('einheit: ' + value); |
850ccfe5f3c4
Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
490
diff
changeset
|
67 var store = Ext.data.StoreManager.get('StaMesseinheiten'); |
850ccfe5f3c4
Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
490
diff
changeset
|
68 /* if (!store) { |
850ccfe5f3c4
Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
490
diff
changeset
|
69 store = Ext.create('Lada.store.StaMesseinheiten'); |
183
ceb04286152a
Added missing file.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff
changeset
|
70 } |
490
446e99cfd425
Updated views and controllers using the new model and stores.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
472
diff
changeset
|
71 */ console.log(store.getById(value)); |
491
850ccfe5f3c4
Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
490
diff
changeset
|
72 return store.findRecord('id', value).get('einheit'); |
850ccfe5f3c4
Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
490
diff
changeset
|
73 } |
850ccfe5f3c4
Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
490
diff
changeset
|
74 }, { |
850ccfe5f3c4
Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
490
diff
changeset
|
75 header: 'Grenzwertüberschreitung', |
850ccfe5f3c4
Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
490
diff
changeset
|
76 dataIndex: 'grenzwertueberschreitung', |
850ccfe5f3c4
Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
490
diff
changeset
|
77 flex: 1, |
850ccfe5f3c4
Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
490
diff
changeset
|
78 renderer: function(value) { |
850ccfe5f3c4
Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
490
diff
changeset
|
79 if (value === true) { |
850ccfe5f3c4
Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
490
diff
changeset
|
80 return "Ja"; |
850ccfe5f3c4
Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
490
diff
changeset
|
81 } else { |
850ccfe5f3c4
Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
490
diff
changeset
|
82 return "Nein"; |
183
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 } |
491
850ccfe5f3c4
Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
490
diff
changeset
|
85 }]; |
183
ceb04286152a
Added missing file.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff
changeset
|
86 this.callParent(arguments); |
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 }); |
ceb04286152a
Added missing file.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff
changeset
|
89 |