annotate app/view/messungen/List.js @ 517:89e3725211ca

Removed save and cancel button from edit messung dialog.
author Raimund Renkert <raimund.renkert@intevation.de>
date Tue, 16 Dec 2014 16:55:16 +0100
parents 6de00657cd87
children 7a20e3054c9e
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: ['->', {
491
850ccfe5f3c4 Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 490
diff changeset
38 text: 'Hinzufügen',
850ccfe5f3c4 Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 490
diff changeset
39 icon: 'gfx/list-add.png',
850ccfe5f3c4 Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 490
diff changeset
40 action: 'add',
850ccfe5f3c4 Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 490
diff changeset
41 probeId: this.probeId
850ccfe5f3c4 Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 490
diff changeset
42 }, {
850ccfe5f3c4 Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 490
diff changeset
43 text: 'Löschen',
850ccfe5f3c4 Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 490
diff changeset
44 icon: 'gfx/list-remove.png',
850ccfe5f3c4 Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 490
diff changeset
45 action: 'delete'
511
83a98b61546a Make tables editable for 'Messungen'
Roland Geider <roland.geider@intevation.de>
parents: 502
diff changeset
46 }, {
83a98b61546a Make tables editable for 'Messungen'
Roland Geider <roland.geider@intevation.de>
parents: 502
diff changeset
47 text: 'Öffnen',
83a98b61546a Make tables editable for 'Messungen'
Roland Geider <roland.geider@intevation.de>
parents: 502
diff changeset
48 icon: 'gfx/document-open.png',
83a98b61546a Make tables editable for 'Messungen'
Roland Geider <roland.geider@intevation.de>
parents: 502
diff changeset
49 action: 'open'
491
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');
511
83a98b61546a Make tables editable for 'Messungen'
Roland Geider <roland.geider@intevation.de>
parents: 502
diff changeset
100 },
83a98b61546a Make tables editable for 'Messungen'
Roland Geider <roland.geider@intevation.de>
parents: 502
diff changeset
101 editor: {
83a98b61546a Make tables editable for 'Messungen'
Roland Geider <roland.geider@intevation.de>
parents: 502
diff changeset
102 xtype: 'numberfield',
513
6de00657cd87 Moved alll list toolbars to bottom and buttons to the right.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 511
diff changeset
103 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
104 }
491
850ccfe5f3c4 Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 490
diff changeset
105 }, {
850ccfe5f3c4 Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 490
diff changeset
106 header: 'OK-Flag',
502
484e12e89d54 Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 491
diff changeset
107 dataIndex: 'fertig',
484e12e89d54 Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 491
diff changeset
108 width: 50,
491
850ccfe5f3c4 Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 490
diff changeset
109 renderer: function(value) {
850ccfe5f3c4 Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 490
diff changeset
110 if (value) {
502
484e12e89d54 Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 491
diff changeset
111 return 'Ja';
491
850ccfe5f3c4 Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 490
diff changeset
112 }
502
484e12e89d54 Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 491
diff changeset
113 return 'Nein';
511
83a98b61546a Make tables editable for 'Messungen'
Roland Geider <roland.geider@intevation.de>
parents: 502
diff changeset
114 },
83a98b61546a Make tables editable for 'Messungen'
Roland Geider <roland.geider@intevation.de>
parents: 502
diff changeset
115 editor: {
83a98b61546a Make tables editable for 'Messungen'
Roland Geider <roland.geider@intevation.de>
parents: 502
diff changeset
116 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
117 allowBlank: false
491
850ccfe5f3c4 Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 490
diff changeset
118 }
850ccfe5f3c4 Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 490
diff changeset
119 }, {
850ccfe5f3c4 Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 490
diff changeset
120 header: 'Anzahl Nuklide',
850ccfe5f3c4 Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 490
diff changeset
121 dataIndex: 'id',
850ccfe5f3c4 Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 490
diff changeset
122 renderer: function(value) {
850ccfe5f3c4 Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 490
diff changeset
123 var mstore = Ext.getStore('Messwerte');
850ccfe5f3c4 Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 490
diff changeset
124 mstore.load({
850ccfe5f3c4 Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 490
diff changeset
125 params: {
850ccfe5f3c4 Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 490
diff changeset
126 probeId: value.probeId,
850ccfe5f3c4 Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 490
diff changeset
127 messungsId: value.id
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 });
850ccfe5f3c4 Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 490
diff changeset
130 return mstore.getTotalCount();
850ccfe5f3c4 Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 490
diff changeset
131 }
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 header: 'Anzahl Kommentare',
850ccfe5f3c4 Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 490
diff changeset
134 flex: 1,
850ccfe5f3c4 Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 490
diff changeset
135 dataIndex: 'id',
850ccfe5f3c4 Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 490
diff changeset
136 renderer: function(value) {
850ccfe5f3c4 Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 490
diff changeset
137 var kstore = Ext.getStore('KommentareM');
850ccfe5f3c4 Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 490
diff changeset
138 kstore.load({
850ccfe5f3c4 Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 490
diff changeset
139 params: {
850ccfe5f3c4 Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 490
diff changeset
140 probeId: value.probeId,
850ccfe5f3c4 Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 490
diff changeset
141 messungsId: value.id
850ccfe5f3c4 Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 490
diff changeset
142 }
850ccfe5f3c4 Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 490
diff changeset
143 });
850ccfe5f3c4 Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 490
diff changeset
144 return kstore.getTotalCount();
850ccfe5f3c4 Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 490
diff changeset
145 }
850ccfe5f3c4 Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 490
diff changeset
146 }];
103
3552b0ee4526 Added Messungenlist to the Proben eddit view.
Torsten Irländer <torsten@irlaender.de>
parents:
diff changeset
147 this.callParent(arguments);
3552b0ee4526 Added Messungenlist to the Proben eddit view.
Torsten Irländer <torsten@irlaender.de>
parents:
diff changeset
148 }
3552b0ee4526 Added Messungenlist to the Proben eddit view.
Torsten Irländer <torsten@irlaender.de>
parents:
diff changeset
149 });

http://lada.wald.intevation.org