Mercurial > lada > lada-client
annotate app/view/grid/Probenzusatzwert.js @ 640:f4969c71654a
Removed field types from orte model.
author | Raimund Renkert <raimund.renkert@intevation.de> |
---|---|
date | Tue, 17 Mar 2015 16:02:33 +0100 |
parents | f59bda7551d7 |
children | 4a9bd2664da6 |
rev | line source |
---|---|
548
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
1 /* Copyright (C) 2013 by Bundesamt fuer Strahlenschutz |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
2 * Software engineering by Intevation GmbH |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
3 * |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
4 * This file is Free Software under the GNU GPL (v>=3) |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
5 * and comes with ABSOLUTELY NO WARRANTY! Check out |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
6 * the documentation coming with IMIS-Labordaten-Application for details. |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
7 */ |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
8 |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
9 /* |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
10 * Grid to list Probenzusatzwerte |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
11 */ |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
12 Ext.define('Lada.view.grid.Probenzusatzwert', { |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
13 extend: 'Ext.grid.Panel', |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
14 alias: 'widget.probenzusatzwertgrid', |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
15 requires: [ |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
16 'Lada.view.widget.Probenzusatzwert' |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
17 ], |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
18 |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
19 maxHeight: 350, |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
20 emptyText: 'Keine Zusatzwerte gefunden.', |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
21 minHeight: 110, |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
22 viewConfig: { |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
23 deferEmptyText: false |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
24 }, |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
25 margin: '0, 5, 5, 5', |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
26 |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
27 recordId: null, |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
28 |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
29 initComponent: function() { |
571
1dedce48e3e1
Implemented the 'add' button; fixed renderer and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
559
diff
changeset
|
30 this.rowEditing = Ext.create('Ext.grid.plugin.RowEditing', { |
548
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
31 clicksToMoveEditor: 1, |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
32 autoCancel: false |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
33 }); |
571
1dedce48e3e1
Implemented the 'add' button; fixed renderer and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
559
diff
changeset
|
34 this.plugins = [this.rowEditing]; |
548
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
35 this.dockedItems = [{ |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
36 xtype: 'toolbar', |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
37 dock: 'bottom', |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
38 items: ['->', { |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
39 text: 'Hinzufügen', |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
40 icon: 'resources/img/list-add.png', |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
41 action: 'add', |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
42 probeId: this.probeId |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
43 }, { |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
44 text: 'Löschen', |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
45 icon: 'resources/img/list-remove.png', |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
46 action: 'delete' |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
47 }] |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
48 }]; |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
49 this.columns = [{ |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
50 header: 'PZW-ID', |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
51 dataIndex: 'id', |
625
f59bda7551d7
Xtype numbercolumn hinzugefügt,
Dustin Demuth <dustin@intevation.de>
parents:
571
diff
changeset
|
52 flex: 1, |
548
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
53 }, { |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
54 header: 'PZW-Größe', |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
55 dataIndex: 'pzsId', |
625
f59bda7551d7
Xtype numbercolumn hinzugefügt,
Dustin Demuth <dustin@intevation.de>
parents:
571
diff
changeset
|
56 flex: 3, |
548
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
57 renderer: function(value) { |
571
1dedce48e3e1
Implemented the 'add' button; fixed renderer and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
559
diff
changeset
|
58 if (!value || value === '') { |
1dedce48e3e1
Implemented the 'add' button; fixed renderer and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
559
diff
changeset
|
59 return ''; |
1dedce48e3e1
Implemented the 'add' button; fixed renderer and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
559
diff
changeset
|
60 } |
548
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
61 var store = Ext.data.StoreManager.get('probenzusaetze'); |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
62 var record = store.getById(value); |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
63 return record.get('beschreibung'); |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
64 }, |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
65 editor: { |
559
9a414a49dffe
Updated probenuzsatzwert grid columns and editors.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
548
diff
changeset
|
66 xtype: 'combobox', |
9a414a49dffe
Updated probenuzsatzwert grid columns and editors.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
548
diff
changeset
|
67 store: Ext.data.StoreManager.get('probenzusaetze'), |
9a414a49dffe
Updated probenuzsatzwert grid columns and editors.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
548
diff
changeset
|
68 displayField: 'beschreibung', |
9a414a49dffe
Updated probenuzsatzwert grid columns and editors.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
548
diff
changeset
|
69 valueField: 'id', |
9a414a49dffe
Updated probenuzsatzwert grid columns and editors.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
548
diff
changeset
|
70 allowBlank: false |
548
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
71 } |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
72 }, { |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
73 header: 'Messwert', |
559
9a414a49dffe
Updated probenuzsatzwert grid columns and editors.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
548
diff
changeset
|
74 dataIndex: 'messwertPzs', |
625
f59bda7551d7
Xtype numbercolumn hinzugefügt,
Dustin Demuth <dustin@intevation.de>
parents:
571
diff
changeset
|
75 xtype: 'numbercolumn', |
f59bda7551d7
Xtype numbercolumn hinzugefügt,
Dustin Demuth <dustin@intevation.de>
parents:
571
diff
changeset
|
76 flex: 1, |
559
9a414a49dffe
Updated probenuzsatzwert grid columns and editors.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
548
diff
changeset
|
77 editor: { |
625
f59bda7551d7
Xtype numbercolumn hinzugefügt,
Dustin Demuth <dustin@intevation.de>
parents:
571
diff
changeset
|
78 xtype: 'numberfield', |
559
9a414a49dffe
Updated probenuzsatzwert grid columns and editors.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
548
diff
changeset
|
79 allowBlank: false |
9a414a49dffe
Updated probenuzsatzwert grid columns and editors.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
548
diff
changeset
|
80 } |
9a414a49dffe
Updated probenuzsatzwert grid columns and editors.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
548
diff
changeset
|
81 }, { |
9a414a49dffe
Updated probenuzsatzwert grid columns and editors.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
548
diff
changeset
|
82 header: 'Maßeinheit', |
9a414a49dffe
Updated probenuzsatzwert grid columns and editors.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
548
diff
changeset
|
83 dataIndex: 'pzsId', |
625
f59bda7551d7
Xtype numbercolumn hinzugefügt,
Dustin Demuth <dustin@intevation.de>
parents:
571
diff
changeset
|
84 flex: 1, |
548
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
85 renderer: function(value) { |
571
1dedce48e3e1
Implemented the 'add' button; fixed renderer and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
559
diff
changeset
|
86 if (!value || value === '') { |
1dedce48e3e1
Implemented the 'add' button; fixed renderer and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
559
diff
changeset
|
87 return ''; |
1dedce48e3e1
Implemented the 'add' button; fixed renderer and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
559
diff
changeset
|
88 } |
559
9a414a49dffe
Updated probenuzsatzwert grid columns and editors.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
548
diff
changeset
|
89 var zstore = Ext.data.StoreManager.get('probenzusaetze'); |
9a414a49dffe
Updated probenuzsatzwert grid columns and editors.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
548
diff
changeset
|
90 var mstore = Ext.data.StoreManager.get('messeinheiten'); |
9a414a49dffe
Updated probenuzsatzwert grid columns and editors.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
548
diff
changeset
|
91 var mehId = zstore.getById(value).get('mehId'); |
9a414a49dffe
Updated probenuzsatzwert grid columns and editors.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
548
diff
changeset
|
92 var record = mstore.findRecord('id', mehId); |
9a414a49dffe
Updated probenuzsatzwert grid columns and editors.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
548
diff
changeset
|
93 return record.get('einheit'); |
9a414a49dffe
Updated probenuzsatzwert grid columns and editors.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
548
diff
changeset
|
94 } |
9a414a49dffe
Updated probenuzsatzwert grid columns and editors.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
548
diff
changeset
|
95 }, { |
9a414a49dffe
Updated probenuzsatzwert grid columns and editors.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
548
diff
changeset
|
96 header: 'Nachweisgrenze', |
9a414a49dffe
Updated probenuzsatzwert grid columns and editors.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
548
diff
changeset
|
97 dataIndex: 'nwgZuMesswert', |
625
f59bda7551d7
Xtype numbercolumn hinzugefügt,
Dustin Demuth <dustin@intevation.de>
parents:
571
diff
changeset
|
98 xtype: 'numbercolumn', |
f59bda7551d7
Xtype numbercolumn hinzugefügt,
Dustin Demuth <dustin@intevation.de>
parents:
571
diff
changeset
|
99 format: '0', |
f59bda7551d7
Xtype numbercolumn hinzugefügt,
Dustin Demuth <dustin@intevation.de>
parents:
571
diff
changeset
|
100 flex: 1, |
559
9a414a49dffe
Updated probenuzsatzwert grid columns and editors.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
548
diff
changeset
|
101 editor: { |
625
f59bda7551d7
Xtype numbercolumn hinzugefügt,
Dustin Demuth <dustin@intevation.de>
parents:
571
diff
changeset
|
102 xtype: 'numberfield', |
559
9a414a49dffe
Updated probenuzsatzwert grid columns and editors.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
548
diff
changeset
|
103 allowBlank: false |
548
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
104 } |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
105 }, { |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
106 header: 'rel. Unsich.[%]', |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
107 dataIndex: 'messfehler', |
625
f59bda7551d7
Xtype numbercolumn hinzugefügt,
Dustin Demuth <dustin@intevation.de>
parents:
571
diff
changeset
|
108 xtype: 'numbercolumn', |
f59bda7551d7
Xtype numbercolumn hinzugefügt,
Dustin Demuth <dustin@intevation.de>
parents:
571
diff
changeset
|
109 format: '0', |
f59bda7551d7
Xtype numbercolumn hinzugefügt,
Dustin Demuth <dustin@intevation.de>
parents:
571
diff
changeset
|
110 flex: 1, |
548
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
111 editor: { |
625
f59bda7551d7
Xtype numbercolumn hinzugefügt,
Dustin Demuth <dustin@intevation.de>
parents:
571
diff
changeset
|
112 xtype: 'numberfield', |
548
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
113 allowBlank: false |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
114 } |
625
f59bda7551d7
Xtype numbercolumn hinzugefügt,
Dustin Demuth <dustin@intevation.de>
parents:
571
diff
changeset
|
115 }, { |
f59bda7551d7
Xtype numbercolumn hinzugefügt,
Dustin Demuth <dustin@intevation.de>
parents:
571
diff
changeset
|
116 header: '< NWG', |
f59bda7551d7
Xtype numbercolumn hinzugefügt,
Dustin Demuth <dustin@intevation.de>
parents:
571
diff
changeset
|
117 flex: 1, |
f59bda7551d7
Xtype numbercolumn hinzugefügt,
Dustin Demuth <dustin@intevation.de>
parents:
571
diff
changeset
|
118 renderer: function(value, meta, record) { |
f59bda7551d7
Xtype numbercolumn hinzugefügt,
Dustin Demuth <dustin@intevation.de>
parents:
571
diff
changeset
|
119 var nwg = record.get('nwgZuMesswert'); |
f59bda7551d7
Xtype numbercolumn hinzugefügt,
Dustin Demuth <dustin@intevation.de>
parents:
571
diff
changeset
|
120 var mw = record.get('messwertPzs'); |
f59bda7551d7
Xtype numbercolumn hinzugefügt,
Dustin Demuth <dustin@intevation.de>
parents:
571
diff
changeset
|
121 if ( mw < nwg) { |
f59bda7551d7
Xtype numbercolumn hinzugefügt,
Dustin Demuth <dustin@intevation.de>
parents:
571
diff
changeset
|
122 return 'MW < NWG'; |
f59bda7551d7
Xtype numbercolumn hinzugefügt,
Dustin Demuth <dustin@intevation.de>
parents:
571
diff
changeset
|
123 } |
f59bda7551d7
Xtype numbercolumn hinzugefügt,
Dustin Demuth <dustin@intevation.de>
parents:
571
diff
changeset
|
124 return ''; |
f59bda7551d7
Xtype numbercolumn hinzugefügt,
Dustin Demuth <dustin@intevation.de>
parents:
571
diff
changeset
|
125 } |
548
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
126 }]; |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
127 this.initData(); |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
128 this.callParent(arguments); |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
129 }, |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
130 |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
131 initData: function() { |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
132 this.store = Ext.create('Lada.store.Zusatzwerte'); |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
133 this.store.load({ |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
134 params: { |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
135 probeId: this.recordId |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
136 } |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
137 }); |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
138 } |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
139 }); |