annotate app/view/zusatzwerte/List.js @ 476:584003637a6b

Texte zwischen README und INSTALL verschoben
author Torsten Irländer <torsten.irlaender@intevation.de>
date Mon, 20 Jan 2014 15:16:14 +0100
parents debfcc7713e3
children 446e99cfd425
rev   line source
472
debfcc7713e3 Added license header to each file.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 391
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: 391
diff changeset
2 * Software engineering by Intevation GmbH
debfcc7713e3 Added license header to each file.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 391
diff changeset
3 *
debfcc7713e3 Added license header to each file.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 391
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: 391
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: 391
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: 391
diff changeset
7 */
debfcc7713e3 Added license header to each file.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 391
diff changeset
8
351
8cb393ffe844 Added documenation
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 141
diff changeset
9 /*
8cb393ffe844 Added documenation
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 141
diff changeset
10 * Grid to list Probenzusatzwerte
8cb393ffe844 Added documenation
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 141
diff changeset
11 */
106
b91d5376db19 Load Zusatzwerte from server
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
12 Ext.define('Lada.view.zusatzwerte.List' ,{
b91d5376db19 Load Zusatzwerte from server
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
13 extend: 'Ext.grid.Panel',
b91d5376db19 Load Zusatzwerte from server
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
14 alias: 'widget.zusatzwertelist',
b91d5376db19 Load Zusatzwerte from server
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
15 store: 'Zusatzwerte',
b91d5376db19 Load Zusatzwerte from server
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
16 viewConfig: {
b91d5376db19 Load Zusatzwerte from server
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
17 maxHeight: 350,
b91d5376db19 Load Zusatzwerte from server
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
18 emptyText: 'Keine Zusatzwerte gefunden.',
b91d5376db19 Load Zusatzwerte from server
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
19 // minHeight and deferEmptyText are needed to be able to show the
b91d5376db19 Load Zusatzwerte from server
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
20 // emptyText message.
b91d5376db19 Load Zusatzwerte from server
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
21 minHeight: 35,
b91d5376db19 Load Zusatzwerte from server
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
22 deferEmptyText: false
b91d5376db19 Load Zusatzwerte from server
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
23 },
125
324b11db4323 Store probeId as attribute of the "add" button in the zusatzwerte list.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 123
diff changeset
24 probeId: null,
106
b91d5376db19 Load Zusatzwerte from server
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
25 initComponent: function() {
b91d5376db19 Load Zusatzwerte from server
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
26 this.dockedItems = [
b91d5376db19 Load Zusatzwerte from server
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
27 {
b91d5376db19 Load Zusatzwerte from server
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
28 xtype: 'toolbar',
b91d5376db19 Load Zusatzwerte from server
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
29 dock: 'top',
b91d5376db19 Load Zusatzwerte from server
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
30 items: [
b91d5376db19 Load Zusatzwerte from server
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
31 {
b91d5376db19 Load Zusatzwerte from server
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
32 text: 'Hinzufügen',
391
d1bb925bb5f5 Use the new icons in list views and status bar.
Raimund Renkert <rrenkert@intevation.de>
parents: 351
diff changeset
33 icon: 'gfx/list-add.png',
125
324b11db4323 Store probeId as attribute of the "add" button in the zusatzwerte list.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 123
diff changeset
34 action: 'add',
324b11db4323 Store probeId as attribute of the "add" button in the zusatzwerte list.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 123
diff changeset
35 probeId: this.probeId
106
b91d5376db19 Load Zusatzwerte from server
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
36 },
b91d5376db19 Load Zusatzwerte from server
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
37 {
b91d5376db19 Load Zusatzwerte from server
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
38 text: 'Löschen',
391
d1bb925bb5f5 Use the new icons in list views and status bar.
Raimund Renkert <rrenkert@intevation.de>
parents: 351
diff changeset
39 icon: 'gfx/list-remove.png',
106
b91d5376db19 Load Zusatzwerte from server
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
40 action: 'delete'
b91d5376db19 Load Zusatzwerte from server
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
41 }
b91d5376db19 Load Zusatzwerte from server
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
42 ]
b91d5376db19 Load Zusatzwerte from server
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
43 }
b91d5376db19 Load Zusatzwerte from server
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
44 ];
b91d5376db19 Load Zusatzwerte from server
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
45 this.columns = [
123
d78bb4ca6089 Enabled accessing nested data in the grid through a renderer.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 114
diff changeset
46 {
d78bb4ca6089 Enabled accessing nested data in the grid through a renderer.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 114
diff changeset
47 header: 'PZW-ID',
136
4dc84682110d Removed nested elements in Zusatzwerte. Change getting aditional info for
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 125
diff changeset
48 dataIndex: 'pzsId'
123
d78bb4ca6089 Enabled accessing nested data in the grid through a renderer.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 114
diff changeset
49 },
d78bb4ca6089 Enabled accessing nested data in the grid through a renderer.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 114
diff changeset
50 {
d78bb4ca6089 Enabled accessing nested data in the grid through a renderer.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 114
diff changeset
51 header: 'PZW-Größe',
136
4dc84682110d Removed nested elements in Zusatzwerte. Change getting aditional info for
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 125
diff changeset
52 dataIndex: 'pzsId',
123
d78bb4ca6089 Enabled accessing nested data in the grid through a renderer.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 114
diff changeset
53 renderer: function(value) {
136
4dc84682110d Removed nested elements in Zusatzwerte. Change getting aditional info for
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 125
diff changeset
54 var store = Ext.getStore('Probenzusatzwerte');
4dc84682110d Removed nested elements in Zusatzwerte. Change getting aditional info for
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 125
diff changeset
55 var record = store.getById(value);
4dc84682110d Removed nested elements in Zusatzwerte. Change getting aditional info for
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 125
diff changeset
56 return record.get('beschreibung');
123
d78bb4ca6089 Enabled accessing nested data in the grid through a renderer.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 114
diff changeset
57 },
d78bb4ca6089 Enabled accessing nested data in the grid through a renderer.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 114
diff changeset
58 flex: 1
d78bb4ca6089 Enabled accessing nested data in the grid through a renderer.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 114
diff changeset
59 },
140
00e43c00b7f2 Display messwert of Zusatzwert with a prepended "<" if the messwert is smaller
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 136
diff changeset
60 {
00e43c00b7f2 Display messwert of Zusatzwert with a prepended "<" if the messwert is smaller
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 136
diff changeset
61 header: 'Messwert',
00e43c00b7f2 Display messwert of Zusatzwert with a prepended "<" if the messwert is smaller
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 136
diff changeset
62 dataIndex: 'pzsId',
00e43c00b7f2 Display messwert of Zusatzwert with a prepended "<" if the messwert is smaller
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 136
diff changeset
63 renderer: function(value) {
00e43c00b7f2 Display messwert of Zusatzwert with a prepended "<" if the messwert is smaller
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 136
diff changeset
64 var store = Ext.getStore('Zusatzwerte');
00e43c00b7f2 Display messwert of Zusatzwert with a prepended "<" if the messwert is smaller
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 136
diff changeset
65 var record = store.getById(value);
00e43c00b7f2 Display messwert of Zusatzwert with a prepended "<" if the messwert is smaller
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 136
diff changeset
66 var messwert = record.get('messwertPzs');
00e43c00b7f2 Display messwert of Zusatzwert with a prepended "<" if the messwert is smaller
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 136
diff changeset
67 var nwg = record.get('nwgZuMesswert');
00e43c00b7f2 Display messwert of Zusatzwert with a prepended "<" if the messwert is smaller
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 136
diff changeset
68 if (messwert < nwg ) {
00e43c00b7f2 Display messwert of Zusatzwert with a prepended "<" if the messwert is smaller
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 136
diff changeset
69 return "<"+messwert;
00e43c00b7f2 Display messwert of Zusatzwert with a prepended "<" if the messwert is smaller
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 136
diff changeset
70 } else {
00e43c00b7f2 Display messwert of Zusatzwert with a prepended "<" if the messwert is smaller
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 136
diff changeset
71 return messwert;
00e43c00b7f2 Display messwert of Zusatzwert with a prepended "<" if the messwert is smaller
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 136
diff changeset
72 }
00e43c00b7f2 Display messwert of Zusatzwert with a prepended "<" if the messwert is smaller
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 136
diff changeset
73 }
00e43c00b7f2 Display messwert of Zusatzwert with a prepended "<" if the messwert is smaller
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 136
diff changeset
74 },
106
b91d5376db19 Load Zusatzwerte from server
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
75 {header: 'rel. Unsich.[%]', dataIndex: 'messfehler'},
123
d78bb4ca6089 Enabled accessing nested data in the grid through a renderer.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 114
diff changeset
76 {
d78bb4ca6089 Enabled accessing nested data in the grid through a renderer.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 114
diff changeset
77 header: 'Maßeinheit',
136
4dc84682110d Removed nested elements in Zusatzwerte. Change getting aditional info for
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 125
diff changeset
78 dataIndex: 'pzsId',
123
d78bb4ca6089 Enabled accessing nested data in the grid through a renderer.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 114
diff changeset
79 renderer: function(value) {
141
1fb79e16149f Displaye Messeinheit in the Zusatzwerte Overview.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 140
diff changeset
80 var zstore = Ext.getStore('Probenzusatzwerte');
1fb79e16149f Displaye Messeinheit in the Zusatzwerte Overview.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 140
diff changeset
81 var mstore = Ext.getStore('Messeinheit');
1fb79e16149f Displaye Messeinheit in the Zusatzwerte Overview.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 140
diff changeset
82 var mehId = zstore.getById(value).get('mehId');
1fb79e16149f Displaye Messeinheit in the Zusatzwerte Overview.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 140
diff changeset
83 var record = mstore.findRecord('mehId', mehId);
1fb79e16149f Displaye Messeinheit in the Zusatzwerte Overview.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 140
diff changeset
84 return record.get('einheit');
123
d78bb4ca6089 Enabled accessing nested data in the grid through a renderer.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 114
diff changeset
85 }
d78bb4ca6089 Enabled accessing nested data in the grid through a renderer.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 114
diff changeset
86 }
106
b91d5376db19 Load Zusatzwerte from server
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
87 ];
b91d5376db19 Load Zusatzwerte from server
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
88 this.callParent(arguments);
b91d5376db19 Load Zusatzwerte from server
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
89 }
b91d5376db19 Load Zusatzwerte from server
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
90 });

http://lada.wald.intevation.org