annotate app/view/messungen/List.js @ 511:83a98b61546a

Make tables editable for 'Messungen' See LSB 3.5
author Roland Geider <roland.geider@intevation.de>
date Mon, 15 Dec 2014 10:50:32 +0100
parents 484e12e89d54
children 6de00657cd87
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,
511
83a98b61546a Make tables editable for 'Messungen'
Roland Geider <roland.geider@intevation.de>
parents: 502
diff changeset
27
83a98b61546a Make tables editable for 'Messungen'
Roland Geider <roland.geider@intevation.de>
parents: 502
diff changeset
28
491
850ccfe5f3c4 Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 490
diff changeset
29
103
3552b0ee4526 Added Messungenlist to the Proben eddit view.
Torsten Irländer <torsten@irlaender.de>
parents:
diff changeset
30 initComponent: function() {
511
83a98b61546a Make tables editable for 'Messungen'
Roland Geider <roland.geider@intevation.de>
parents: 502
diff changeset
31 var rowEditing = Ext.create('Ext.grid.plugin.RowEditing', {
83a98b61546a Make tables editable for 'Messungen'
Roland Geider <roland.geider@intevation.de>
parents: 502
diff changeset
32 clicksToMoveEditor: 1,
83a98b61546a Make tables editable for 'Messungen'
Roland Geider <roland.geider@intevation.de>
parents: 502
diff changeset
33 autoCancel: false
83a98b61546a Make tables editable for 'Messungen'
Roland Geider <roland.geider@intevation.de>
parents: 502
diff changeset
34 });
83a98b61546a Make tables editable for 'Messungen'
Roland Geider <roland.geider@intevation.de>
parents: 502
diff changeset
35
83a98b61546a Make tables editable for 'Messungen'
Roland Geider <roland.geider@intevation.de>
parents: 502
diff changeset
36 this.plugins = [rowEditing];
83a98b61546a Make tables editable for 'Messungen'
Roland Geider <roland.geider@intevation.de>
parents: 502
diff changeset
37
491
850ccfe5f3c4 Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 490
diff changeset
38 this.dockedItems = [{
850ccfe5f3c4 Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 490
diff changeset
39 xtype: 'toolbar',
850ccfe5f3c4 Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 490
diff changeset
40 dock: 'top',
850ccfe5f3c4 Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 490
diff changeset
41 items: [{
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'
511
83a98b61546a Make tables editable for 'Messungen'
Roland Geider <roland.geider@intevation.de>
parents: 502
diff changeset
50 }, {
83a98b61546a Make tables editable for 'Messungen'
Roland Geider <roland.geider@intevation.de>
parents: 502
diff changeset
51 text: 'Öffnen',
83a98b61546a Make tables editable for 'Messungen'
Roland Geider <roland.geider@intevation.de>
parents: 502
diff changeset
52 icon: 'gfx/document-open.png',
83a98b61546a Make tables editable for 'Messungen'
Roland Geider <roland.geider@intevation.de>
parents: 502
diff changeset
53 action: 'open'
491
850ccfe5f3c4 Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 490
diff changeset
54 }]
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 this.columns = [{
850ccfe5f3c4 Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 490
diff changeset
57 header: 'Mess.ID',
511
83a98b61546a Make tables editable for 'Messungen'
Roland Geider <roland.geider@intevation.de>
parents: 502
diff changeset
58 editor: {
83a98b61546a Make tables editable for 'Messungen'
Roland Geider <roland.geider@intevation.de>
parents: 502
diff changeset
59 allowBlank: false
83a98b61546a Make tables editable for 'Messungen'
Roland Geider <roland.geider@intevation.de>
parents: 502
diff changeset
60 },
502
484e12e89d54 Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 491
diff changeset
61 dataIndex: 'id',
491
850ccfe5f3c4 Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 490
diff changeset
62 width: 50
850ccfe5f3c4 Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 490
diff changeset
63 }, {
850ccfe5f3c4 Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 490
diff changeset
64 header: 'NPR-Nr.',
511
83a98b61546a Make tables editable for 'Messungen'
Roland Geider <roland.geider@intevation.de>
parents: 502
diff changeset
65 editor: {
83a98b61546a Make tables editable for 'Messungen'
Roland Geider <roland.geider@intevation.de>
parents: 502
diff changeset
66 allowBlank: false
83a98b61546a Make tables editable for 'Messungen'
Roland Geider <roland.geider@intevation.de>
parents: 502
diff changeset
67 },
502
484e12e89d54 Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 491
diff changeset
68 dataIndex: 'nebenprobenNr',
491
850ccfe5f3c4 Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 490
diff changeset
69 width: 50
850ccfe5f3c4 Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 490
diff changeset
70 }, {
850ccfe5f3c4 Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 490
diff changeset
71 header: 'MMT',
511
83a98b61546a Make tables editable for 'Messungen'
Roland Geider <roland.geider@intevation.de>
parents: 502
diff changeset
72 editor: {
83a98b61546a Make tables editable for 'Messungen'
Roland Geider <roland.geider@intevation.de>
parents: 502
diff changeset
73 allowBlank: false
83a98b61546a Make tables editable for 'Messungen'
Roland Geider <roland.geider@intevation.de>
parents: 502
diff changeset
74 },
502
484e12e89d54 Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 491
diff changeset
75 dataIndex: 'mmtId',
491
850ccfe5f3c4 Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 490
diff changeset
76 width: 50
850ccfe5f3c4 Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 490
diff changeset
77 }, {
850ccfe5f3c4 Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 490
diff changeset
78 header: 'Messzeit',
511
83a98b61546a Make tables editable for 'Messungen'
Roland Geider <roland.geider@intevation.de>
parents: 502
diff changeset
79 editor: {
83a98b61546a Make tables editable for 'Messungen'
Roland Geider <roland.geider@intevation.de>
parents: 502
diff changeset
80 xtype: 'datefield',
83a98b61546a Make tables editable for 'Messungen'
Roland Geider <roland.geider@intevation.de>
parents: 502
diff changeset
81 allowBlank: false,
83a98b61546a Make tables editable for 'Messungen'
Roland Geider <roland.geider@intevation.de>
parents: 502
diff changeset
82 format: 'd.m.Y',
83a98b61546a Make tables editable for 'Messungen'
Roland Geider <roland.geider@intevation.de>
parents: 502
diff changeset
83 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
84 //minText: 'Fehlertext', // TODO: Fehlertext falls minValue
83a98b61546a Make tables editable for 'Messungen'
Roland Geider <roland.geider@intevation.de>
parents: 502
diff changeset
85 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
86 },
502
484e12e89d54 Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 491
diff changeset
87 dataIndex: 'messzeitpunkt'
491
850ccfe5f3c4 Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 490
diff changeset
88 }, {
850ccfe5f3c4 Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 490
diff changeset
89 header: 'Status',
850ccfe5f3c4 Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 490
diff changeset
90 dataIndex: 'id',
502
484e12e89d54 Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 491
diff changeset
91 width: 50,
491
850ccfe5f3c4 Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 490
diff changeset
92 renderer: function(value) {
850ccfe5f3c4 Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 490
diff changeset
93 var sstore = Ext.getStore('Status');
850ccfe5f3c4 Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 490
diff changeset
94 sstore.load({
850ccfe5f3c4 Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 490
diff changeset
95 params: {
850ccfe5f3c4 Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 490
diff changeset
96 probeId: value.probeId,
850ccfe5f3c4 Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 490
diff changeset
97 messungsId: value.id
103
3552b0ee4526 Added Messungenlist to the Proben eddit view.
Torsten Irländer <torsten@irlaender.de>
parents:
diff changeset
98 }
491
850ccfe5f3c4 Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 490
diff changeset
99 });
850ccfe5f3c4 Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 490
diff changeset
100 if (sstore.getTotalCount() === 0) {
502
484e12e89d54 Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 491
diff changeset
101 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
102 }
502
484e12e89d54 Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 491
diff changeset
103 return sstore.last().get('status');
511
83a98b61546a Make tables editable for 'Messungen'
Roland Geider <roland.geider@intevation.de>
parents: 502
diff changeset
104 },
83a98b61546a Make tables editable for 'Messungen'
Roland Geider <roland.geider@intevation.de>
parents: 502
diff changeset
105 editor: {
83a98b61546a Make tables editable for 'Messungen'
Roland Geider <roland.geider@intevation.de>
parents: 502
diff changeset
106 xtype: 'numberfield',
83a98b61546a Make tables editable for 'Messungen'
Roland Geider <roland.geider@intevation.de>
parents: 502
diff changeset
107 allowBlank: false,
164
767300b2c70f Added custom renderer for "Anzahl Kommentare" column count the number of
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 103
diff changeset
108 }
491
850ccfe5f3c4 Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 490
diff changeset
109 }, {
850ccfe5f3c4 Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 490
diff changeset
110 header: 'OK-Flag',
502
484e12e89d54 Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 491
diff changeset
111 dataIndex: 'fertig',
484e12e89d54 Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 491
diff changeset
112 width: 50,
491
850ccfe5f3c4 Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 490
diff changeset
113 renderer: function(value) {
850ccfe5f3c4 Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 490
diff changeset
114 if (value) {
502
484e12e89d54 Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 491
diff changeset
115 return 'Ja';
491
850ccfe5f3c4 Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 490
diff changeset
116 }
502
484e12e89d54 Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 491
diff changeset
117 return 'Nein';
511
83a98b61546a Make tables editable for 'Messungen'
Roland Geider <roland.geider@intevation.de>
parents: 502
diff changeset
118 },
83a98b61546a Make tables editable for 'Messungen'
Roland Geider <roland.geider@intevation.de>
parents: 502
diff changeset
119 editor: {
83a98b61546a Make tables editable for 'Messungen'
Roland Geider <roland.geider@intevation.de>
parents: 502
diff changeset
120 xtype: 'checkboxfield',
83a98b61546a Make tables editable for 'Messungen'
Roland Geider <roland.geider@intevation.de>
parents: 502
diff changeset
121 allowBlank: false,
491
850ccfe5f3c4 Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 490
diff changeset
122 }
850ccfe5f3c4 Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 490
diff changeset
123 }, {
850ccfe5f3c4 Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 490
diff changeset
124 header: 'Anzahl Nuklide',
850ccfe5f3c4 Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 490
diff changeset
125 dataIndex: 'id',
850ccfe5f3c4 Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 490
diff changeset
126 renderer: function(value) {
850ccfe5f3c4 Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 490
diff changeset
127 var mstore = Ext.getStore('Messwerte');
850ccfe5f3c4 Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 490
diff changeset
128 mstore.load({
850ccfe5f3c4 Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 490
diff changeset
129 params: {
850ccfe5f3c4 Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 490
diff changeset
130 probeId: value.probeId,
850ccfe5f3c4 Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 490
diff changeset
131 messungsId: value.id
850ccfe5f3c4 Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 490
diff changeset
132 }
850ccfe5f3c4 Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 490
diff changeset
133 });
850ccfe5f3c4 Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 490
diff changeset
134 return mstore.getTotalCount();
850ccfe5f3c4 Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 490
diff changeset
135 }
850ccfe5f3c4 Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 490
diff changeset
136 }, {
850ccfe5f3c4 Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 490
diff changeset
137 header: 'Anzahl Kommentare',
850ccfe5f3c4 Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 490
diff changeset
138 flex: 1,
850ccfe5f3c4 Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 490
diff changeset
139 dataIndex: 'id',
850ccfe5f3c4 Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 490
diff changeset
140 renderer: function(value) {
850ccfe5f3c4 Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 490
diff changeset
141 var kstore = Ext.getStore('KommentareM');
850ccfe5f3c4 Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 490
diff changeset
142 kstore.load({
850ccfe5f3c4 Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 490
diff changeset
143 params: {
850ccfe5f3c4 Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 490
diff changeset
144 probeId: value.probeId,
850ccfe5f3c4 Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 490
diff changeset
145 messungsId: value.id
850ccfe5f3c4 Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 490
diff changeset
146 }
850ccfe5f3c4 Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 490
diff changeset
147 });
850ccfe5f3c4 Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 490
diff changeset
148 return kstore.getTotalCount();
850ccfe5f3c4 Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 490
diff changeset
149 }
850ccfe5f3c4 Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 490
diff changeset
150 }];
103
3552b0ee4526 Added Messungenlist to the Proben eddit view.
Torsten Irländer <torsten@irlaender.de>
parents:
diff changeset
151 this.callParent(arguments);
3552b0ee4526 Added Messungenlist to the Proben eddit view.
Torsten Irländer <torsten@irlaender.de>
parents:
diff changeset
152 }
3552b0ee4526 Added Messungenlist to the Proben eddit view.
Torsten Irländer <torsten@irlaender.de>
parents:
diff changeset
153 });

http://lada.wald.intevation.org