Mercurial > lada > lada-client
annotate app/view/messwerte/List.js @ 540:99e738c17b81
Add detail button to tables
author | Roland Geider <roland.geider@intevation.de> |
---|---|
date | Wed, 17 Dec 2014 16:59:45 +0100 |
parents | eef1ff9f2bd2 |
children | 7c9475119861 |
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 |
497
7c0653e8d9f7
Fixed some js related issues (unused vars, arrays, etc.) and code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
496
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:
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 */ |
497
7c0653e8d9f7
Fixed some js related issues (unused vars, arrays, etc.) and code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
496
diff
changeset
|
12 Ext.define('Lada.view.messwerte.List', { |
183
ceb04286152a
Added missing file.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff
changeset
|
13 extend: 'Ext.grid.Panel', |
ceb04286152a
Added missing file.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff
changeset
|
14 alias: 'widget.messwertelist', |
491
850ccfe5f3c4
Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
490
diff
changeset
|
15 |
183
ceb04286152a
Added missing file.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff
changeset
|
16 store: 'Messwerte', |
ceb04286152a
Added missing file.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff
changeset
|
17 viewConfig: { |
ceb04286152a
Added missing file.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff
changeset
|
18 maxHeight: 350, |
ceb04286152a
Added missing file.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff
changeset
|
19 emptyText: 'Keine Messwerte gefunden.', |
ceb04286152a
Added missing file.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff
changeset
|
20 // 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
|
21 // emptyText message. |
530
95bad130be98
Increased list grid height.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
525
diff
changeset
|
22 minHeight: 65, |
183
ceb04286152a
Added missing file.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff
changeset
|
23 deferEmptyText: false |
ceb04286152a
Added missing file.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff
changeset
|
24 }, |
491
850ccfe5f3c4
Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
490
diff
changeset
|
25 |
183
ceb04286152a
Added missing file.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff
changeset
|
26 probeId: null, |
210
f3a2f985f451
Set parentId to messwert for add button
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
183
diff
changeset
|
27 parentId: null, |
491
850ccfe5f3c4
Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
490
diff
changeset
|
28 |
183
ceb04286152a
Added missing file.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff
changeset
|
29 initComponent: function() { |
525
5960189e4461
Make tables editable for 'Messwerte'
Roland Geider <roland.geider@intevation.de>
parents:
513
diff
changeset
|
30 var rowEditing = Ext.create('Ext.grid.plugin.RowEditing', { |
5960189e4461
Make tables editable for 'Messwerte'
Roland Geider <roland.geider@intevation.de>
parents:
513
diff
changeset
|
31 clicksToMoveEditor: 1, |
5960189e4461
Make tables editable for 'Messwerte'
Roland Geider <roland.geider@intevation.de>
parents:
513
diff
changeset
|
32 autoCancel: false |
5960189e4461
Make tables editable for 'Messwerte'
Roland Geider <roland.geider@intevation.de>
parents:
513
diff
changeset
|
33 }); |
5960189e4461
Make tables editable for 'Messwerte'
Roland Geider <roland.geider@intevation.de>
parents:
513
diff
changeset
|
34 |
5960189e4461
Make tables editable for 'Messwerte'
Roland Geider <roland.geider@intevation.de>
parents:
513
diff
changeset
|
35 this.plugins = [rowEditing]; |
5960189e4461
Make tables editable for 'Messwerte'
Roland Geider <roland.geider@intevation.de>
parents:
513
diff
changeset
|
36 |
491
850ccfe5f3c4
Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
490
diff
changeset
|
37 this.dockedItems = [{ |
850ccfe5f3c4
Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
490
diff
changeset
|
38 xtype: 'toolbar', |
513
6de00657cd87
Moved alll list toolbars to bottom and buttons to the right.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
499
diff
changeset
|
39 dock: 'bottom', |
6de00657cd87
Moved alll list toolbars to bottom and buttons to the right.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
499
diff
changeset
|
40 items: ['->', { |
540
99e738c17b81
Add detail button to tables
Roland Geider <roland.geider@intevation.de>
parents:
538
diff
changeset
|
41 text: 'Details', |
99e738c17b81
Add detail button to tables
Roland Geider <roland.geider@intevation.de>
parents:
538
diff
changeset
|
42 icon: 'gfx/document-open.png', |
99e738c17b81
Add detail button to tables
Roland Geider <roland.geider@intevation.de>
parents:
538
diff
changeset
|
43 action: 'open' |
99e738c17b81
Add detail button to tables
Roland Geider <roland.geider@intevation.de>
parents:
538
diff
changeset
|
44 }, { |
491
850ccfe5f3c4
Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
490
diff
changeset
|
45 text: 'Hinzufügen', |
850ccfe5f3c4
Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
490
diff
changeset
|
46 icon: 'gfx/list-add.png', |
850ccfe5f3c4
Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
490
diff
changeset
|
47 action: 'add', |
850ccfe5f3c4
Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
490
diff
changeset
|
48 probeId: this.probeId, |
850ccfe5f3c4
Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
490
diff
changeset
|
49 parentId: this.parentId |
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 text: 'Löschen', |
850ccfe5f3c4
Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
490
diff
changeset
|
52 icon: 'gfx/list-remove.png', |
850ccfe5f3c4
Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
490
diff
changeset
|
53 action: 'delete' |
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: '<NWG', |
525
5960189e4461
Make tables editable for 'Messwerte'
Roland Geider <roland.geider@intevation.de>
parents:
513
diff
changeset
|
58 dataIndex: 'messwertNwg', |
5960189e4461
Make tables editable for 'Messwerte'
Roland Geider <roland.geider@intevation.de>
parents:
513
diff
changeset
|
59 editor: { |
534
0eb7751ce158
Render the NWG field in a combobox
Roland Geider <roland.geider@intevation.de>
parents:
525
diff
changeset
|
60 xtype: 'nwg', |
525
5960189e4461
Make tables editable for 'Messwerte'
Roland Geider <roland.geider@intevation.de>
parents:
513
diff
changeset
|
61 allowBlank: false |
5960189e4461
Make tables editable for 'Messwerte'
Roland Geider <roland.geider@intevation.de>
parents:
513
diff
changeset
|
62 } |
491
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: 'Messwert', |
525
5960189e4461
Make tables editable for 'Messwerte'
Roland Geider <roland.geider@intevation.de>
parents:
513
diff
changeset
|
65 dataIndex: 'messwert', |
5960189e4461
Make tables editable for 'Messwerte'
Roland Geider <roland.geider@intevation.de>
parents:
513
diff
changeset
|
66 editor: { |
5960189e4461
Make tables editable for 'Messwerte'
Roland Geider <roland.geider@intevation.de>
parents:
513
diff
changeset
|
67 xtype: 'numberfield', |
5960189e4461
Make tables editable for 'Messwerte'
Roland Geider <roland.geider@intevation.de>
parents:
513
diff
changeset
|
68 allowBlank: false |
5960189e4461
Make tables editable for 'Messwerte'
Roland Geider <roland.geider@intevation.de>
parents:
513
diff
changeset
|
69 } |
491
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: 'Messfehler', |
525
5960189e4461
Make tables editable for 'Messwerte'
Roland Geider <roland.geider@intevation.de>
parents:
513
diff
changeset
|
72 dataIndex: 'messfehler', |
5960189e4461
Make tables editable for 'Messwerte'
Roland Geider <roland.geider@intevation.de>
parents:
513
diff
changeset
|
73 editor: { |
5960189e4461
Make tables editable for 'Messwerte'
Roland Geider <roland.geider@intevation.de>
parents:
513
diff
changeset
|
74 xtype: 'numberfield', |
5960189e4461
Make tables editable for 'Messwerte'
Roland Geider <roland.geider@intevation.de>
parents:
513
diff
changeset
|
75 allowBlank: false |
5960189e4461
Make tables editable for 'Messwerte'
Roland Geider <roland.geider@intevation.de>
parents:
513
diff
changeset
|
76 } |
491
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: 'Messgröße', |
850ccfe5f3c4
Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
490
diff
changeset
|
79 dataIndex: 'messgroesseId', |
850ccfe5f3c4
Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
490
diff
changeset
|
80 renderer: function(value) { |
496
d07e5086a64b
Moved stammdaten stores to app.js and load them via storemanager.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
491
diff
changeset
|
81 var store = Ext.data.StoreManager.get('staMessgroessen'); |
491
850ccfe5f3c4
Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
490
diff
changeset
|
82 return store.findRecord('id', value).get('messgroesse'); |
525
5960189e4461
Make tables editable for 'Messwerte'
Roland Geider <roland.geider@intevation.de>
parents:
513
diff
changeset
|
83 }, |
5960189e4461
Make tables editable for 'Messwerte'
Roland Geider <roland.geider@intevation.de>
parents:
513
diff
changeset
|
84 editor: { |
5960189e4461
Make tables editable for 'Messwerte'
Roland Geider <roland.geider@intevation.de>
parents:
513
diff
changeset
|
85 xtype: 'messgroesse', |
5960189e4461
Make tables editable for 'Messwerte'
Roland Geider <roland.geider@intevation.de>
parents:
513
diff
changeset
|
86 allowBlank: false |
183
ceb04286152a
Added missing file.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff
changeset
|
87 } |
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: 'Messeinheit', |
850ccfe5f3c4
Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
490
diff
changeset
|
90 dataIndex: 'mehId', |
850ccfe5f3c4
Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
490
diff
changeset
|
91 renderer: function(value) { |
496
d07e5086a64b
Moved stammdaten stores to app.js and load them via storemanager.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
491
diff
changeset
|
92 var store = Ext.data.StoreManager.get('staMesseinheiten'); |
491
850ccfe5f3c4
Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
490
diff
changeset
|
93 return store.findRecord('id', value).get('einheit'); |
525
5960189e4461
Make tables editable for 'Messwerte'
Roland Geider <roland.geider@intevation.de>
parents:
513
diff
changeset
|
94 }, |
5960189e4461
Make tables editable for 'Messwerte'
Roland Geider <roland.geider@intevation.de>
parents:
513
diff
changeset
|
95 editor: { |
5960189e4461
Make tables editable for 'Messwerte'
Roland Geider <roland.geider@intevation.de>
parents:
513
diff
changeset
|
96 xtype: 'messeinheit', |
5960189e4461
Make tables editable for 'Messwerte'
Roland Geider <roland.geider@intevation.de>
parents:
513
diff
changeset
|
97 allowBlank: false |
491
850ccfe5f3c4
Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
490
diff
changeset
|
98 } |
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 header: 'Grenzwertüberschreitung', |
850ccfe5f3c4
Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
490
diff
changeset
|
101 dataIndex: 'grenzwertueberschreitung', |
850ccfe5f3c4
Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
490
diff
changeset
|
102 flex: 1, |
850ccfe5f3c4
Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
490
diff
changeset
|
103 renderer: function(value) { |
850ccfe5f3c4
Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
490
diff
changeset
|
104 if (value === true) { |
497
7c0653e8d9f7
Fixed some js related issues (unused vars, arrays, etc.) and code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
496
diff
changeset
|
105 return 'Ja'; |
183
ceb04286152a
Added missing file.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff
changeset
|
106 } |
497
7c0653e8d9f7
Fixed some js related issues (unused vars, arrays, etc.) and code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
496
diff
changeset
|
107 return 'Nein'; |
525
5960189e4461
Make tables editable for 'Messwerte'
Roland Geider <roland.geider@intevation.de>
parents:
513
diff
changeset
|
108 }, |
5960189e4461
Make tables editable for 'Messwerte'
Roland Geider <roland.geider@intevation.de>
parents:
513
diff
changeset
|
109 editor: { |
5960189e4461
Make tables editable for 'Messwerte'
Roland Geider <roland.geider@intevation.de>
parents:
513
diff
changeset
|
110 xtype: 'checkboxfield' |
183
ceb04286152a
Added missing file.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff
changeset
|
111 } |
491
850ccfe5f3c4
Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
490
diff
changeset
|
112 }]; |
183
ceb04286152a
Added missing file.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff
changeset
|
113 this.callParent(arguments); |
ceb04286152a
Added missing file.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff
changeset
|
114 } |
ceb04286152a
Added missing file.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff
changeset
|
115 }); |