Mercurial > lada > lada-client
comparison app/view/grid/Messwert.js @ 1119:b73f9a976c82
Exponential notation without tampering numbers.
Rounding is done by the server. Thus, the client should not fix the
number of digits, except only for rendering.
author | Tom Gottfried <tom@intevation.de> |
---|---|
date | Mon, 23 May 2016 16:00:50 +0200 |
parents | e76551a6da27 |
children | 4f68511ce7a4 |
comparison
equal
deleted
inserted
replaced
1118:ea5774447e49 | 1119:b73f9a976c82 |
---|---|
12 Ext.define('Lada.view.grid.Messwert', { | 12 Ext.define('Lada.view.grid.Messwert', { |
13 extend: 'Ext.grid.Panel', | 13 extend: 'Ext.grid.Panel', |
14 alias: 'widget.messwertgrid', | 14 alias: 'widget.messwertgrid', |
15 | 15 |
16 requires: [ | 16 requires: [ |
17 'Lada.view.form.ExpNumberField', | |
17 'Lada.view.widget.Messgroesse', | 18 'Lada.view.widget.Messgroesse', |
18 'Lada.view.widget.Messeinheit' | 19 'Lada.view.widget.Messeinheit' |
19 ], | 20 ], |
20 | 21 |
21 maxHeight: 350, | 22 maxHeight: 350, |
112 }, { | 113 }, { |
113 header: 'Messwert', | 114 header: 'Messwert', |
114 dataIndex: 'messwert', | 115 dataIndex: 'messwert', |
115 width: 80, | 116 width: 80, |
116 editor: { | 117 editor: { |
117 xtype: 'textfield', | 118 xtype: 'expnumberfield', |
118 allowBlank: false, | 119 allowBlank: false, |
119 regex: /^[+\-]?(?:(?:0|[1-9]\d*)(?:[\.\,][0-9]\d*)?(?:[eE][+\-]?\d+)|(\d+[\.\,]?\d*)?)$/, | 120 }, |
120 regexText: 'Keine Zahl' | 121 renderer: function(value) { |
122 return value.toExponential(2).toString().replace('.', ','); | |
121 } | 123 } |
122 }, { | 124 }, { |
123 header: 'Messeinheit', | 125 header: 'Messeinheit', |
124 dataIndex: 'mehId', | 126 dataIndex: 'mehId', |
125 width: 90, | 127 width: 90, |
159 }, { | 161 }, { |
160 header: 'Nachweisgrenze', | 162 header: 'Nachweisgrenze', |
161 dataIndex: 'nwgZuMesswert', | 163 dataIndex: 'nwgZuMesswert', |
162 width: 80, | 164 width: 80, |
163 editor: { | 165 editor: { |
164 xtype: 'textfield', | 166 xtype: 'expnumberfield' |
165 allowBlank: true, | 167 }, |
166 regex: /^[+\-]?(?:(?:0|[1-9]\d*)(?:[\.\,][0-9]\d*)?(?:[eE][+\-]?\d+)|(\d+[\.\,]?\d*)?)$/, | 168 renderer: function(value) { |
167 regexText: 'Keine Zahl' | 169 if (!value || value === '') { |
170 return value; | |
171 } | |
172 return value.toExponential(2).toString().replace('.', ','); | |
168 } | 173 } |
169 }, { | 174 }, { |
170 header: 'Grenzwertüberschreitung', | 175 header: 'Grenzwertüberschreitung', |
171 dataIndex: 'grenzwertueberschreitung', | 176 dataIndex: 'grenzwertueberschreitung', |
172 flex: 1, | 177 flex: 1, |