Mercurial > lada > lada-client
annotate app/view/zusatzwerte/List.js @ 443:0ab89a3b9090
Added new widget to enter the value for messwertNwg in when creating new messwerte.
author | Torsten Irländer <torsten.irlaender@intevation.de> |
---|---|
date | Tue, 03 Dec 2013 11:24:13 +0100 |
parents | d1bb925bb5f5 |
children | debfcc7713e3 |
rev | line source |
---|---|
351
8cb393ffe844
Added documenation
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
141
diff
changeset
|
1 /* |
8cb393ffe844
Added documenation
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
141
diff
changeset
|
2 * Grid to list Probenzusatzwerte |
8cb393ffe844
Added documenation
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
141
diff
changeset
|
3 */ |
106
b91d5376db19
Load Zusatzwerte from server
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff
changeset
|
4 Ext.define('Lada.view.zusatzwerte.List' ,{ |
b91d5376db19
Load Zusatzwerte from server
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff
changeset
|
5 extend: 'Ext.grid.Panel', |
b91d5376db19
Load Zusatzwerte from server
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff
changeset
|
6 alias: 'widget.zusatzwertelist', |
b91d5376db19
Load Zusatzwerte from server
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff
changeset
|
7 store: 'Zusatzwerte', |
b91d5376db19
Load Zusatzwerte from server
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff
changeset
|
8 viewConfig: { |
b91d5376db19
Load Zusatzwerte from server
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff
changeset
|
9 maxHeight: 350, |
b91d5376db19
Load Zusatzwerte from server
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff
changeset
|
10 emptyText: 'Keine Zusatzwerte gefunden.', |
b91d5376db19
Load Zusatzwerte from server
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff
changeset
|
11 // 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
|
12 // emptyText message. |
b91d5376db19
Load Zusatzwerte from server
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff
changeset
|
13 minHeight: 35, |
b91d5376db19
Load Zusatzwerte from server
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff
changeset
|
14 deferEmptyText: false |
b91d5376db19
Load Zusatzwerte from server
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff
changeset
|
15 }, |
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
|
16 probeId: null, |
106
b91d5376db19
Load Zusatzwerte from server
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff
changeset
|
17 initComponent: function() { |
b91d5376db19
Load Zusatzwerte from server
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff
changeset
|
18 this.dockedItems = [ |
b91d5376db19
Load Zusatzwerte from server
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff
changeset
|
19 { |
b91d5376db19
Load Zusatzwerte from server
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff
changeset
|
20 xtype: 'toolbar', |
b91d5376db19
Load Zusatzwerte from server
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff
changeset
|
21 dock: 'top', |
b91d5376db19
Load Zusatzwerte from server
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff
changeset
|
22 items: [ |
b91d5376db19
Load Zusatzwerte from server
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff
changeset
|
23 { |
b91d5376db19
Load Zusatzwerte from server
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff
changeset
|
24 text: 'Hinzufügen', |
391
d1bb925bb5f5
Use the new icons in list views and status bar.
Raimund Renkert <rrenkert@intevation.de>
parents:
351
diff
changeset
|
25 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
|
26 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
|
27 probeId: this.probeId |
106
b91d5376db19
Load Zusatzwerte from server
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff
changeset
|
28 }, |
b91d5376db19
Load Zusatzwerte from server
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff
changeset
|
29 { |
b91d5376db19
Load Zusatzwerte from server
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff
changeset
|
30 text: 'Löschen', |
391
d1bb925bb5f5
Use the new icons in list views and status bar.
Raimund Renkert <rrenkert@intevation.de>
parents:
351
diff
changeset
|
31 icon: 'gfx/list-remove.png', |
106
b91d5376db19
Load Zusatzwerte from server
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff
changeset
|
32 action: 'delete' |
b91d5376db19
Load Zusatzwerte from server
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff
changeset
|
33 } |
b91d5376db19
Load Zusatzwerte from server
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff
changeset
|
34 ] |
b91d5376db19
Load Zusatzwerte from server
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff
changeset
|
35 } |
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 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
|
38 { |
d78bb4ca6089
Enabled accessing nested data in the grid through a renderer.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
114
diff
changeset
|
39 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
|
40 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
|
41 }, |
d78bb4ca6089
Enabled accessing nested data in the grid through a renderer.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
114
diff
changeset
|
42 { |
d78bb4ca6089
Enabled accessing nested data in the grid through a renderer.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
114
diff
changeset
|
43 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
|
44 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
|
45 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
|
46 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
|
47 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
|
48 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
|
49 }, |
d78bb4ca6089
Enabled accessing nested data in the grid through a renderer.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
114
diff
changeset
|
50 flex: 1 |
d78bb4ca6089
Enabled accessing nested data in the grid through a renderer.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
114
diff
changeset
|
51 }, |
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
|
52 { |
00e43c00b7f2
Display messwert of Zusatzwert with a prepended "<" if the messwert is smaller
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
136
diff
changeset
|
53 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
|
54 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
|
55 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
|
56 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
|
57 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
|
58 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
|
59 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
|
60 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
|
61 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
|
62 } 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
|
63 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
|
64 } |
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 } |
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 }, |
106
b91d5376db19
Load Zusatzwerte from server
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff
changeset
|
67 {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
|
68 { |
d78bb4ca6089
Enabled accessing nested data in the grid through a renderer.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
114
diff
changeset
|
69 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
|
70 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
|
71 renderer: function(value) { |
141
1fb79e16149f
Displaye Messeinheit in the Zusatzwerte Overview.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
140
diff
changeset
|
72 var zstore = Ext.getStore('Probenzusatzwerte'); |
1fb79e16149f
Displaye Messeinheit in the Zusatzwerte Overview.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
140
diff
changeset
|
73 var mstore = Ext.getStore('Messeinheit'); |
1fb79e16149f
Displaye Messeinheit in the Zusatzwerte Overview.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
140
diff
changeset
|
74 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
|
75 var record = mstore.findRecord('mehId', mehId); |
1fb79e16149f
Displaye Messeinheit in the Zusatzwerte Overview.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
140
diff
changeset
|
76 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
|
77 } |
d78bb4ca6089
Enabled accessing nested data in the grid through a renderer.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
114
diff
changeset
|
78 } |
106
b91d5376db19
Load Zusatzwerte from server
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff
changeset
|
79 ]; |
b91d5376db19
Load Zusatzwerte from server
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff
changeset
|
80 this.callParent(arguments); |
b91d5376db19
Load Zusatzwerte from server
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff
changeset
|
81 } |
b91d5376db19
Load Zusatzwerte from server
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff
changeset
|
82 }); |