diff app/view/grid/Probenzusatzwert.js @ 665:4a9bd2664da6

Field Validity in Probenzusatzwerte Grid
author Dustin Demuth <dustin@intevation.de>
date Thu, 19 Mar 2015 11:33:43 +0100
parents f59bda7551d7
children 612f4f933083
line wrap: on
line diff
--- a/app/view/grid/Probenzusatzwert.js	Thu Mar 19 11:25:38 2015 +0100
+++ b/app/view/grid/Probenzusatzwert.js	Thu Mar 19 11:33:43 2015 +0100
@@ -67,7 +67,8 @@
                 store: Ext.data.StoreManager.get('probenzusaetze'),
                 displayField: 'beschreibung',
                 valueField: 'id',
-                allowBlank: false
+                allowBlank: false,
+                editable: false
             }
         }, {
             header: 'Messwert',
@@ -76,7 +77,34 @@
             flex: 1,
             editor: {
                 xtype: 'numberfield',
-                allowBlank: false
+                allowBlank: false,
+                maxLength: 10,
+                enforceMaxLength: true,
+                allowExponential: false
+            }
+        }, {
+            header: '< NWG',
+            flex: 1,
+            renderer: function(value, meta, record) {
+                var nwg = record.get('nwgZuMesswert');
+                var mw = record.get('messwertPzs');
+                if ( mw < nwg) {
+                    return '<';
+                }
+                return '';
+            }
+        }, {
+            header: 'Nachweisgrenze',
+            dataIndex: 'nwgZuMesswert',
+            xtype: 'numbercolumn',
+            format: '0',
+            flex: 1,
+            editor: {
+                xtype: 'numberfield',
+                allowBlank: false,
+                maxLength: 10,
+                enforceMaxLength: true,
+                allowExponential: false
             }
         }, {
             header: 'Maßeinheit',
@@ -93,16 +121,6 @@
                 return record.get('einheit');
             }
         }, {
-            header: 'Nachweisgrenze',
-            dataIndex: 'nwgZuMesswert',
-            xtype: 'numbercolumn',
-            format: '0',
-            flex: 1,
-            editor: {
-                xtype: 'numberfield',
-                allowBlank: false
-            }
-        }, {
             header: 'rel. Unsich.[%]',
             dataIndex: 'messfehler',
             xtype: 'numbercolumn',
@@ -110,18 +128,11 @@
             flex: 1,
             editor: {
                 xtype: 'numberfield',
-                allowBlank: false
-            }
-        }, {
-            header: '< NWG',
-            flex: 1,
-            renderer: function(value, meta, record) {
-                var nwg = record.get('nwgZuMesswert');
-                var mw = record.get('messwertPzs');
-                if ( mw < nwg) {
-                    return 'MW < NWG';
-                }
-                return '';
+                allowBlank: false,
+                maxLength: 3,
+                enforceMaxLength: true,
+                allowExponential: false,
+                allowDecimal: false
             }
         }];
         this.initData();

http://lada.wald.intevation.org