changeset 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 8972f008dfb1
children 381066c87ba8
files app/controller/Messwert.js app/view/messwerte/List.js
diffstat 2 files changed, 35 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/app/controller/Messwert.js	Tue Dec 16 16:20:42 2014 +0100
+++ b/app/controller/Messwert.js	Tue Dec 16 18:21:19 2014 +0100
@@ -28,9 +28,9 @@
 
     addListeners: function() {
         this.control({
-            'messwertelist': {
-                itemdblclick: this.editItem
-            },
+            //'messwertelist': {
+            //    itemdblclick: this.editItem
+            //},
             'messwertelist toolbar button[action=add]': {
                 click: this.addItem
             },
--- 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