Mercurial > lada > lada-client
annotate app/view/zusatzwerte/List.js @ 136:4dc84682110d
Removed nested elements in Zusatzwerte. Change getting aditional info for
Probenzusätze in the Zusatzwert listing.
author | Torsten Irländer <torsten.irlaender@intevation.de> |
---|---|
date | Wed, 26 Jun 2013 10:18:08 +0200 |
parents | 324b11db4323 |
children | 00e43c00b7f2 |
rev | line source |
---|---|
106
b91d5376db19
Load Zusatzwerte from server
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff
changeset
|
1 Ext.define('Lada.view.zusatzwerte.List' ,{ |
b91d5376db19
Load Zusatzwerte from server
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff
changeset
|
2 extend: 'Ext.grid.Panel', |
b91d5376db19
Load Zusatzwerte from server
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff
changeset
|
3 alias: 'widget.zusatzwertelist', |
b91d5376db19
Load Zusatzwerte from server
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff
changeset
|
4 store: 'Zusatzwerte', |
b91d5376db19
Load Zusatzwerte from server
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff
changeset
|
5 viewConfig: { |
b91d5376db19
Load Zusatzwerte from server
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff
changeset
|
6 maxHeight: 350, |
b91d5376db19
Load Zusatzwerte from server
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff
changeset
|
7 emptyText: 'Keine Zusatzwerte gefunden.', |
b91d5376db19
Load Zusatzwerte from server
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff
changeset
|
8 // 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
|
9 // emptyText message. |
b91d5376db19
Load Zusatzwerte from server
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff
changeset
|
10 minHeight: 35, |
b91d5376db19
Load Zusatzwerte from server
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff
changeset
|
11 deferEmptyText: false |
b91d5376db19
Load Zusatzwerte from server
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff
changeset
|
12 }, |
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
|
13 probeId: null, |
106
b91d5376db19
Load Zusatzwerte from server
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff
changeset
|
14 initComponent: function() { |
b91d5376db19
Load Zusatzwerte from server
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff
changeset
|
15 this.dockedItems = [ |
b91d5376db19
Load Zusatzwerte from server
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff
changeset
|
16 { |
b91d5376db19
Load Zusatzwerte from server
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff
changeset
|
17 xtype: 'toolbar', |
b91d5376db19
Load Zusatzwerte from server
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff
changeset
|
18 dock: 'top', |
b91d5376db19
Load Zusatzwerte from server
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff
changeset
|
19 items: [ |
b91d5376db19
Load Zusatzwerte from server
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff
changeset
|
20 { |
b91d5376db19
Load Zusatzwerte from server
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff
changeset
|
21 text: 'Hinzufügen', |
b91d5376db19
Load Zusatzwerte from server
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff
changeset
|
22 icon: 'gfx/plus.gif', |
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
|
23 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
|
24 probeId: this.probeId |
106
b91d5376db19
Load Zusatzwerte from server
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff
changeset
|
25 }, |
b91d5376db19
Load Zusatzwerte from server
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff
changeset
|
26 { |
b91d5376db19
Load Zusatzwerte from server
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff
changeset
|
27 text: 'Löschen', |
b91d5376db19
Load Zusatzwerte from server
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff
changeset
|
28 icon: 'gfx/minus.gif', |
b91d5376db19
Load Zusatzwerte from server
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff
changeset
|
29 action: 'delete' |
b91d5376db19
Load Zusatzwerte from server
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff
changeset
|
30 } |
b91d5376db19
Load Zusatzwerte from server
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff
changeset
|
31 ] |
b91d5376db19
Load Zusatzwerte from server
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff
changeset
|
32 } |
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 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
|
35 { |
d78bb4ca6089
Enabled accessing nested data in the grid through a renderer.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
114
diff
changeset
|
36 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
|
37 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
|
38 }, |
d78bb4ca6089
Enabled accessing nested data in the grid through a renderer.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
114
diff
changeset
|
39 { |
d78bb4ca6089
Enabled accessing nested data in the grid through a renderer.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
114
diff
changeset
|
40 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
|
41 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
|
42 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
|
43 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
|
44 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
|
45 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
|
46 }, |
d78bb4ca6089
Enabled accessing nested data in the grid through a renderer.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
114
diff
changeset
|
47 flex: 1 |
d78bb4ca6089
Enabled accessing nested data in the grid through a renderer.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
114
diff
changeset
|
48 }, |
114
189a93e31be9
Worked on Zusatzwerte. No all values are displayed correct in the List and
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
106
diff
changeset
|
49 {header: 'Messwert', dataIndex: 'messwertPzs'}, |
106
b91d5376db19
Load Zusatzwerte from server
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff
changeset
|
50 {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
|
51 { |
d78bb4ca6089
Enabled accessing nested data in the grid through a renderer.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
114
diff
changeset
|
52 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
|
53 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
|
54 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
|
55 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
|
56 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
|
57 return record.get('mehId'); |
123
d78bb4ca6089
Enabled accessing nested data in the grid through a renderer.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
114
diff
changeset
|
58 } |
d78bb4ca6089
Enabled accessing nested data in the grid through a renderer.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
114
diff
changeset
|
59 } |
106
b91d5376db19
Load Zusatzwerte from server
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff
changeset
|
60 ]; |
b91d5376db19
Load Zusatzwerte from server
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff
changeset
|
61 this.callParent(arguments); |
b91d5376db19
Load Zusatzwerte from server
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff
changeset
|
62 } |
b91d5376db19
Load Zusatzwerte from server
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff
changeset
|
63 }); |