comparison app/view/grid/Probenzusatzwert.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 7e801af49eeb
children 4f68511ce7a4
comparison
equal deleted inserted replaced
1118:ea5774447e49 1119:b73f9a976c82
11 */ 11 */
12 Ext.define('Lada.view.grid.Probenzusatzwert', { 12 Ext.define('Lada.view.grid.Probenzusatzwert', {
13 extend: 'Ext.grid.Panel', 13 extend: 'Ext.grid.Panel',
14 alias: 'widget.probenzusatzwertgrid', 14 alias: 'widget.probenzusatzwertgrid',
15 requires: [ 15 requires: [
16 'Lada.view.form.ExpNumberField',
16 'Lada.view.widget.Probenzusatzwert' 17 'Lada.view.widget.Probenzusatzwert'
17 ], 18 ],
18 19
19 maxHeight: 350, 20 maxHeight: 350,
20 emptyText: 'Keine Zusatzwerte gefunden.', 21 emptyText: 'Keine Zusatzwerte gefunden.',
90 }, { 91 }, {
91 header: 'Messwert', 92 header: 'Messwert',
92 dataIndex: 'messwertPzs', 93 dataIndex: 'messwertPzs',
93 flex: 1, 94 flex: 1,
94 editor: { 95 editor: {
95 xtype: 'textfield', 96 xtype: 'expnumberfield',
96 allowBlank: false, 97 },
97 regex: /^[+\-]?(?:(?:0|[1-9]\d*)(?:[\.\,][0-9]\d*)?(?:[eE][+\-]?\d+)|(\d+[\.\,]?\d*)?)$/, 98 renderer: function(value) {
98 regexText: 'Keine Zahl' 99 if (!value || value === '') {
100 return value;
101 }
102 return value.toExponential(2).toString().replace('.', ',');
99 } 103 }
100 }, { 104 }, {
101 header: '< NWG', 105 header: '< NWG',
102 flex: 1, 106 flex: 1,
103 renderer: function(value, meta, record) { 107 renderer: function(value, meta, record) {
112 header: 'Nachweisgrenze', 116 header: 'Nachweisgrenze',
113 dataIndex: 'nwgZuMesswert', 117 dataIndex: 'nwgZuMesswert',
114 xtype: 'numbercolumn', 118 xtype: 'numbercolumn',
115 flex: 1, 119 flex: 1,
116 editor: { 120 editor: {
117 xtype: 'textfield', 121 xtype: 'expnumberfield',
118 allowBlank: false, 122 },
119 regex: /^[+\-]?(?:(?:0|[1-9]\d*)(?:[\.\,][0-9]\d*)?(?:[eE][+\-]?\d+)|(\d+[\.\,]?\d*)?)$/, 123 renderer: function(value) {
120 regexText: 'Keine Zahl' 124 if (!value || value === '') {
125 return value;
126 }
127 return value.toExponential(2).toString().replace('.', ',');
121 } 128 }
122 }, { 129 }, {
123 header: 'Maßeinheit', 130 header: 'Maßeinheit',
124 dataIndex: 'pzsId', 131 dataIndex: 'pzsId',
125 flex: 1, 132 flex: 1,

http://lada.wald.intevation.org