[Lada-commits] [PATCH 5 of 6] Make tables editable for 'Messwerte'

Wald Commits scm-commit at wald.intevation.org
Tue Dec 16 18:22:15 CET 2014


# HG changeset patch
# User Roland Geider <roland.geider at intevation.de>
# Date 1418750479 -3600
# Node ID 5960189e4461ecd7730d391ff98fa6da7a5e2235
# Parent  8972f008dfb1ffa1dcb821fa985f730286a63834
Make tables editable for 'Messwerte'

See LSB 3.5

diff -r 8972f008dfb1 -r 5960189e4461 app/controller/Messwert.js
--- 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
             },
diff -r 8972f008dfb1 -r 5960189e4461 app/view/messwerte/List.js
--- 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: '<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);


More information about the Lada-commits mailing list