Mercurial > lada > lada-client
comparison app/view/grid/Probenzusatzwert.js @ 548:d47ee7439f44
Added new js files.
author | Raimund Renkert <raimund.renkert@intevation.de> |
---|---|
date | Fri, 06 Mar 2015 12:43:52 +0100 |
parents | |
children | 9a414a49dffe |
comparison
equal
deleted
inserted
replaced
547:f172b35a3b92 | 548:d47ee7439f44 |
---|---|
1 /* Copyright (C) 2013 by Bundesamt fuer Strahlenschutz | |
2 * Software engineering by Intevation GmbH | |
3 * | |
4 * This file is Free Software under the GNU GPL (v>=3) | |
5 * and comes with ABSOLUTELY NO WARRANTY! Check out | |
6 * the documentation coming with IMIS-Labordaten-Application for details. | |
7 */ | |
8 | |
9 /* | |
10 * Grid to list Probenzusatzwerte | |
11 */ | |
12 Ext.define('Lada.view.grid.Probenzusatzwert', { | |
13 extend: 'Ext.grid.Panel', | |
14 alias: 'widget.probenzusatzwertgrid', | |
15 requires: [ | |
16 'Lada.view.widget.Probenzusatzwert' | |
17 ], | |
18 | |
19 maxHeight: 350, | |
20 emptyText: 'Keine Zusatzwerte gefunden.', | |
21 minHeight: 110, | |
22 viewConfig: { | |
23 deferEmptyText: false | |
24 }, | |
25 margin: '0, 5, 5, 5', | |
26 | |
27 recordId: null, | |
28 | |
29 initComponent: function() { | |
30 var rowEditing = Ext.create('Ext.grid.plugin.RowEditing', { | |
31 clicksToMoveEditor: 1, | |
32 autoCancel: false | |
33 }); | |
34 this.plugins = [rowEditing]; | |
35 this.dockedItems = [{ | |
36 xtype: 'toolbar', | |
37 dock: 'bottom', | |
38 items: ['->', { | |
39 text: 'Details', | |
40 icon: 'resources/img/document-open.png', | |
41 action: 'open', | |
42 disabled: true | |
43 }, { | |
44 text: 'Hinzufügen', | |
45 icon: 'resources/img/list-add.png', | |
46 action: 'add', | |
47 probeId: this.probeId | |
48 }, { | |
49 text: 'Löschen', | |
50 icon: 'resources/img/list-remove.png', | |
51 action: 'delete' | |
52 }] | |
53 }]; | |
54 this.columns = [{ | |
55 header: 'PZW-ID', | |
56 dataIndex: 'id', | |
57 editor: { | |
58 xtype: 'numberfield', | |
59 allowBlank: false | |
60 } | |
61 }, { | |
62 header: 'PZW-Größe', | |
63 dataIndex: 'pzsId', | |
64 renderer: function(value) { | |
65 var store = Ext.data.StoreManager.get('probenzusaetze'); | |
66 var record = store.getById(value); | |
67 return record.get('beschreibung'); | |
68 }, | |
69 flex: 1, | |
70 editor: { | |
71 xtype: 'probenzusatzwert' | |
72 } | |
73 }, { | |
74 header: 'Messwert', | |
75 dataIndex: 'id', | |
76 renderer: function(value) { | |
77 var record = this.store.getById(value); | |
78 var messwert = record.get('messwertPzs'); | |
79 var nwg = record.get('nwgZuMesswert'); | |
80 if (messwert < nwg) { | |
81 return '<' + messwert; | |
82 } | |
83 return messwert; | |
84 } | |
85 }, { | |
86 header: 'rel. Unsich.[%]', | |
87 dataIndex: 'messfehler', | |
88 editor: { | |
89 allowBlank: false | |
90 } | |
91 }, { | |
92 header: 'Maßeinheit', | |
93 dataIndex: 'pzsId', | |
94 renderer: function(value) { | |
95 var zstore = Ext.data.StoreManager.get('probenzusaetze'); | |
96 var mstore = Ext.data.StoreManager.get('messeinheiten'); | |
97 var mehId = zstore.getById(value).get('mehId'); | |
98 var record = mstore.findRecord('id', mehId); | |
99 return record.get('einheit'); | |
100 } | |
101 }]; | |
102 this.initData(); | |
103 this.callParent(arguments); | |
104 }, | |
105 | |
106 initData: function() { | |
107 this.store = Ext.create('Lada.store.Zusatzwerte'); | |
108 this.store.load({ | |
109 params: { | |
110 probeId: this.recordId | |
111 } | |
112 }); | |
113 } | |
114 }); |