annotate app/view/messungen/List.js @ 537:a12c9c97d3cb

Make tables editable for 'Zusatzwerte' See LSB 3.5
author Roland Geider <roland.geider@intevation.de>
date Wed, 17 Dec 2014 15:41:35 +0100
parents 60c5c796a57e
children eef1ff9f2bd2
rev   line source
472
debfcc7713e3 Added license header to each file.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 455
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: 455
diff changeset
2 * Software engineering by Intevation GmbH
debfcc7713e3 Added license header to each file.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 455
diff changeset
3 *
debfcc7713e3 Added license header to each file.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 455
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: 455
diff changeset
5 * and comes with ABSOLUTELY NO WARRANTY! Check out
502
484e12e89d54 Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 491
diff changeset
6 * the documentation coming with IMIS-Labordaten-Application for details.
472
debfcc7713e3 Added license header to each file.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 455
diff changeset
7 */
debfcc7713e3 Added license header to each file.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 455
diff changeset
8
343
eccf58d3b106 Added documentation
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 172
diff changeset
9 /*
eccf58d3b106 Added documentation
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 172
diff changeset
10 * Grid to list Messungen
eccf58d3b106 Added documentation
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 172
diff changeset
11 */
502
484e12e89d54 Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 491
diff changeset
12 Ext.define('Lada.view.messungen.List', {
103
3552b0ee4526 Added Messungenlist to the Proben eddit view.
Torsten Irländer <torsten@irlaender.de>
parents:
diff changeset
13 extend: 'Ext.grid.Panel',
3552b0ee4526 Added Messungenlist to the Proben eddit view.
Torsten Irländer <torsten@irlaender.de>
parents:
diff changeset
14 alias: 'widget.messungenlist',
491
850ccfe5f3c4 Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 490
diff changeset
15
103
3552b0ee4526 Added Messungenlist to the Proben eddit view.
Torsten Irländer <torsten@irlaender.de>
parents:
diff changeset
16 store: 'Messungen',
3552b0ee4526 Added Messungenlist to the Proben eddit view.
Torsten Irländer <torsten@irlaender.de>
parents:
diff changeset
17 viewConfig: {
3552b0ee4526 Added Messungenlist to the Proben eddit view.
Torsten Irländer <torsten@irlaender.de>
parents:
diff changeset
18 maxHeight: 350,
3552b0ee4526 Added Messungenlist to the Proben eddit view.
Torsten Irländer <torsten@irlaender.de>
parents:
diff changeset
19 emptyText: 'Keine Messungen gefunden.',
3552b0ee4526 Added Messungenlist to the Proben eddit view.
Torsten Irländer <torsten@irlaender.de>
parents:
diff changeset
20 // 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
21 // emptyText message.
3552b0ee4526 Added Messungenlist to the Proben eddit view.
Torsten Irländer <torsten@irlaender.de>
parents:
diff changeset
22 minHeight: 35,
3552b0ee4526 Added Messungenlist to the Proben eddit view.
Torsten Irländer <torsten@irlaender.de>
parents:
diff changeset
23 deferEmptyText: false
3552b0ee4526 Added Messungenlist to the Proben eddit view.
Torsten Irländer <torsten@irlaender.de>
parents:
diff changeset
24 },
491
850ccfe5f3c4 Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 490
diff changeset
25
172
cfa0cc437781 Implemented opening a new Messungen form when clicking and the "Add Button" on
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 171
diff changeset
26 probeId: null,
491
850ccfe5f3c4 Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 490
diff changeset
27
103
3552b0ee4526 Added Messungenlist to the Proben eddit view.
Torsten Irländer <torsten@irlaender.de>
parents:
diff changeset
28 initComponent: function() {
511
83a98b61546a Make tables editable for 'Messungen'
Roland Geider <roland.geider@intevation.de>
parents: 502
diff changeset
29 var rowEditing = Ext.create('Ext.grid.plugin.RowEditing', {
83a98b61546a Make tables editable for 'Messungen'
Roland Geider <roland.geider@intevation.de>
parents: 502
diff changeset
30 clicksToMoveEditor: 1,
83a98b61546a Make tables editable for 'Messungen'
Roland Geider <roland.geider@intevation.de>
parents: 502
diff changeset
31 autoCancel: false
83a98b61546a Make tables editable for 'Messungen'
Roland Geider <roland.geider@intevation.de>
parents: 502
diff changeset
32 });
83a98b61546a Make tables editable for 'Messungen'
Roland Geider <roland.geider@intevation.de>
parents: 502
diff changeset
33 this.plugins = [rowEditing];
491
850ccfe5f3c4 Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 490
diff changeset
34 this.dockedItems = [{
850ccfe5f3c4 Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 490
diff changeset
35 xtype: 'toolbar',
513
6de00657cd87 Moved alll list toolbars to bottom and buttons to the right.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 511
diff changeset
36 dock: 'bottom',
6de00657cd87 Moved alll list toolbars to bottom and buttons to the right.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 511
diff changeset
37 items: ['->', {
521
7a20e3054c9e Rename button to 'Details'
Roland Geider <roland.geider@intevation.de>
parents: 513
diff changeset
38 text: 'Details',
7a20e3054c9e Rename button to 'Details'
Roland Geider <roland.geider@intevation.de>
parents: 513
diff changeset
39 icon: 'gfx/document-open.png',
7a20e3054c9e Rename button to 'Details'
Roland Geider <roland.geider@intevation.de>
parents: 513
diff changeset
40 action: 'open'
7a20e3054c9e Rename button to 'Details'
Roland Geider <roland.geider@intevation.de>
parents: 513
diff changeset
41 }, {
491
850ccfe5f3c4 Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 490
diff changeset
42 text: 'Hinzufügen',
850ccfe5f3c4 Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 490
diff changeset
43 icon: 'gfx/list-add.png',
850ccfe5f3c4 Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 490
diff changeset
44 action: 'add',
850ccfe5f3c4 Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 490
diff changeset
45 probeId: this.probeId
850ccfe5f3c4 Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 490
diff changeset
46 }, {
850ccfe5f3c4 Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 490
diff changeset
47 text: 'Löschen',
850ccfe5f3c4 Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 490
diff changeset
48 icon: 'gfx/list-remove.png',
850ccfe5f3c4 Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 490
diff changeset
49 action: 'delete'
850ccfe5f3c4 Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 490
diff changeset
50 }]
850ccfe5f3c4 Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 490
diff changeset
51 }];
850ccfe5f3c4 Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 490
diff changeset
52 this.columns = [{
850ccfe5f3c4 Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 490
diff changeset
53 header: 'Mess.ID',
511
83a98b61546a Make tables editable for 'Messungen'
Roland Geider <roland.geider@intevation.de>
parents: 502
diff changeset
54 editor: {
83a98b61546a Make tables editable for 'Messungen'
Roland Geider <roland.geider@intevation.de>
parents: 502
diff changeset
55 allowBlank: false
83a98b61546a Make tables editable for 'Messungen'
Roland Geider <roland.geider@intevation.de>
parents: 502
diff changeset
56 },
502
484e12e89d54 Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 491
diff changeset
57 dataIndex: 'id',
491
850ccfe5f3c4 Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 490
diff changeset
58 width: 50
850ccfe5f3c4 Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 490
diff changeset
59 }, {
850ccfe5f3c4 Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 490
diff changeset
60 header: 'NPR-Nr.',
511
83a98b61546a Make tables editable for 'Messungen'
Roland Geider <roland.geider@intevation.de>
parents: 502
diff changeset
61 editor: {
83a98b61546a Make tables editable for 'Messungen'
Roland Geider <roland.geider@intevation.de>
parents: 502
diff changeset
62 allowBlank: false
83a98b61546a Make tables editable for 'Messungen'
Roland Geider <roland.geider@intevation.de>
parents: 502
diff changeset
63 },
502
484e12e89d54 Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 491
diff changeset
64 dataIndex: 'nebenprobenNr',
491
850ccfe5f3c4 Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 490
diff changeset
65 width: 50
850ccfe5f3c4 Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 490
diff changeset
66 }, {
850ccfe5f3c4 Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 490
diff changeset
67 header: 'MMT',
511
83a98b61546a Make tables editable for 'Messungen'
Roland Geider <roland.geider@intevation.de>
parents: 502
diff changeset
68 editor: {
83a98b61546a Make tables editable for 'Messungen'
Roland Geider <roland.geider@intevation.de>
parents: 502
diff changeset
69 allowBlank: false
83a98b61546a Make tables editable for 'Messungen'
Roland Geider <roland.geider@intevation.de>
parents: 502
diff changeset
70 },
502
484e12e89d54 Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 491
diff changeset
71 dataIndex: 'mmtId',
491
850ccfe5f3c4 Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 490
diff changeset
72 width: 50
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 header: 'Messzeit',
511
83a98b61546a Make tables editable for 'Messungen'
Roland Geider <roland.geider@intevation.de>
parents: 502
diff changeset
75 editor: {
83a98b61546a Make tables editable for 'Messungen'
Roland Geider <roland.geider@intevation.de>
parents: 502
diff changeset
76 xtype: 'datefield',
83a98b61546a Make tables editable for 'Messungen'
Roland Geider <roland.geider@intevation.de>
parents: 502
diff changeset
77 allowBlank: false,
83a98b61546a Make tables editable for 'Messungen'
Roland Geider <roland.geider@intevation.de>
parents: 502
diff changeset
78 format: 'd.m.Y',
83a98b61546a Make tables editable for 'Messungen'
Roland Geider <roland.geider@intevation.de>
parents: 502
diff changeset
79 minValue: '01.01.2001', // TODO: gibt es ein minValue?
83a98b61546a Make tables editable for 'Messungen'
Roland Geider <roland.geider@intevation.de>
parents: 502
diff changeset
80 //minText: 'Fehlertext', // TODO: Fehlertext falls minValue
83a98b61546a Make tables editable for 'Messungen'
Roland Geider <roland.geider@intevation.de>
parents: 502
diff changeset
81 maxValue: Ext.Date.format(new Date(), 'd.m.Y')
83a98b61546a Make tables editable for 'Messungen'
Roland Geider <roland.geider@intevation.de>
parents: 502
diff changeset
82 },
502
484e12e89d54 Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 491
diff changeset
83 dataIndex: 'messzeitpunkt'
491
850ccfe5f3c4 Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 490
diff changeset
84 }, {
850ccfe5f3c4 Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 490
diff changeset
85 header: 'Status',
850ccfe5f3c4 Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 490
diff changeset
86 dataIndex: 'id',
502
484e12e89d54 Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 491
diff changeset
87 width: 50,
491
850ccfe5f3c4 Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 490
diff changeset
88 renderer: function(value) {
850ccfe5f3c4 Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 490
diff changeset
89 var sstore = Ext.getStore('Status');
850ccfe5f3c4 Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 490
diff changeset
90 sstore.load({
850ccfe5f3c4 Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 490
diff changeset
91 params: {
850ccfe5f3c4 Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 490
diff changeset
92 probeId: value.probeId,
850ccfe5f3c4 Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 490
diff changeset
93 messungsId: value.id
103
3552b0ee4526 Added Messungenlist to the Proben eddit view.
Torsten Irländer <torsten@irlaender.de>
parents:
diff changeset
94 }
491
850ccfe5f3c4 Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 490
diff changeset
95 });
850ccfe5f3c4 Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 490
diff changeset
96 if (sstore.getTotalCount() === 0) {
502
484e12e89d54 Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 491
diff changeset
97 return 'unbekannt';
164
767300b2c70f Added custom renderer for "Anzahl Kommentare" column count the number of
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 103
diff changeset
98 }
502
484e12e89d54 Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 491
diff changeset
99 return sstore.last().get('status');
164
767300b2c70f Added custom renderer for "Anzahl Kommentare" column count the number of
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 103
diff changeset
100 }
491
850ccfe5f3c4 Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 490
diff changeset
101 }, {
850ccfe5f3c4 Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 490
diff changeset
102 header: 'OK-Flag',
502
484e12e89d54 Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 491
diff changeset
103 dataIndex: 'fertig',
484e12e89d54 Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 491
diff changeset
104 width: 50,
491
850ccfe5f3c4 Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 490
diff changeset
105 renderer: function(value) {
850ccfe5f3c4 Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 490
diff changeset
106 if (value) {
502
484e12e89d54 Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 491
diff changeset
107 return 'Ja';
491
850ccfe5f3c4 Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 490
diff changeset
108 }
502
484e12e89d54 Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 491
diff changeset
109 return 'Nein';
511
83a98b61546a Make tables editable for 'Messungen'
Roland Geider <roland.geider@intevation.de>
parents: 502
diff changeset
110 },
83a98b61546a Make tables editable for 'Messungen'
Roland Geider <roland.geider@intevation.de>
parents: 502
diff changeset
111 editor: {
83a98b61546a Make tables editable for 'Messungen'
Roland Geider <roland.geider@intevation.de>
parents: 502
diff changeset
112 xtype: 'checkboxfield',
513
6de00657cd87 Moved alll list toolbars to bottom and buttons to the right.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 511
diff changeset
113 allowBlank: false
491
850ccfe5f3c4 Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 490
diff changeset
114 }
850ccfe5f3c4 Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 490
diff changeset
115 }, {
850ccfe5f3c4 Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 490
diff changeset
116 header: 'Anzahl Nuklide',
850ccfe5f3c4 Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 490
diff changeset
117 dataIndex: 'id',
850ccfe5f3c4 Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 490
diff changeset
118 renderer: function(value) {
850ccfe5f3c4 Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 490
diff changeset
119 var mstore = Ext.getStore('Messwerte');
850ccfe5f3c4 Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 490
diff changeset
120 mstore.load({
850ccfe5f3c4 Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 490
diff changeset
121 params: {
850ccfe5f3c4 Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 490
diff changeset
122 probeId: value.probeId,
850ccfe5f3c4 Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 490
diff changeset
123 messungsId: value.id
850ccfe5f3c4 Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 490
diff changeset
124 }
850ccfe5f3c4 Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 490
diff changeset
125 });
850ccfe5f3c4 Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 490
diff changeset
126 return mstore.getTotalCount();
850ccfe5f3c4 Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 490
diff changeset
127 }
850ccfe5f3c4 Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 490
diff changeset
128 }, {
850ccfe5f3c4 Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 490
diff changeset
129 header: 'Anzahl Kommentare',
850ccfe5f3c4 Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 490
diff changeset
130 flex: 1,
850ccfe5f3c4 Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 490
diff changeset
131 dataIndex: 'id',
850ccfe5f3c4 Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 490
diff changeset
132 renderer: function(value) {
850ccfe5f3c4 Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 490
diff changeset
133 var kstore = Ext.getStore('KommentareM');
850ccfe5f3c4 Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 490
diff changeset
134 kstore.load({
850ccfe5f3c4 Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 490
diff changeset
135 params: {
850ccfe5f3c4 Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 490
diff changeset
136 probeId: value.probeId,
850ccfe5f3c4 Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 490
diff changeset
137 messungsId: value.id
850ccfe5f3c4 Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 490
diff changeset
138 }
850ccfe5f3c4 Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 490
diff changeset
139 });
850ccfe5f3c4 Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 490
diff changeset
140 return kstore.getTotalCount();
850ccfe5f3c4 Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 490
diff changeset
141 }
850ccfe5f3c4 Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 490
diff changeset
142 }];
103
3552b0ee4526 Added Messungenlist to the Proben eddit view.
Torsten Irländer <torsten@irlaender.de>
parents:
diff changeset
143 this.callParent(arguments);
3552b0ee4526 Added Messungenlist to the Proben eddit view.
Torsten Irländer <torsten@irlaender.de>
parents:
diff changeset
144 }
3552b0ee4526 Added Messungenlist to the Proben eddit view.
Torsten Irländer <torsten@irlaender.de>
parents:
diff changeset
145 });

http://lada.wald.intevation.org