diff app/view/messwerte/List.js @ 525:5960189e4461

Make tables editable for 'Messwerte' See LSB 3.5
author Roland Geider <roland.geider@intevation.de>
date Tue, 16 Dec 2014 18:21:19 +0100
parents 6de00657cd87
children 95bad130be98 0eb7751ce158
line wrap: on
line diff
--- a/app/view/messwerte/List.js	Tue Dec 16 16:20:42 2014 +0100
+++ b/app/view/messwerte/List.js	Tue Dec 16 18:21:19 2014 +0100
@@ -27,6 +27,13 @@
     parentId: null,
 
     initComponent: function() {
+        var rowEditing = Ext.create('Ext.grid.plugin.RowEditing', {
+            clicksToMoveEditor: 1,
+            autoCancel: false
+        });
+
+        this.plugins = [rowEditing];
+
         this.dockedItems = [{
             xtype: 'toolbar',
             dock: 'bottom',
@@ -44,19 +51,34 @@
         }];
         this.columns = [{
             header: '&lt;NWG',
-            dataIndex: 'messwertNwg'
+            dataIndex: 'messwertNwg',
+            editor: {
+                allowBlank: false
+            }
         }, {
             header: 'Messwert',
-            dataIndex: 'messwert'
+            dataIndex: 'messwert',
+            editor: {
+                xtype: 'numberfield',
+                allowBlank: false
+            }
         }, {
             header: 'Messfehler',
-            dataIndex: 'messfehler'
+            dataIndex: 'messfehler',
+            editor: {
+                xtype: 'numberfield',
+                allowBlank: false
+            }
         }, {
             header: 'Messgröße',
             dataIndex: 'messgroesseId',
             renderer: function(value) {
                 var store = Ext.data.StoreManager.get('staMessgroessen');
                 return store.findRecord('id', value).get('messgroesse');
+            },
+            editor: {
+                xtype: 'messgroesse',
+                allowBlank: false
             }
         }, {
             header: 'Messeinheit',
@@ -64,6 +86,10 @@
             renderer: function(value) {
                 var store = Ext.data.StoreManager.get('staMesseinheiten');
                 return store.findRecord('id', value).get('einheit');
+            },
+            editor: {
+                xtype: 'messeinheit',
+                allowBlank: false
             }
         }, {
             header: 'Grenzwertüberschreitung',
@@ -74,6 +100,9 @@
                     return 'Ja';
                 }
                 return 'Nein';
+            },
+            editor: {
+                xtype: 'checkboxfield'
             }
         }];
         this.callParent(arguments);

http://lada.wald.intevation.org