changeset 510:1643d74a40bb

Make tables editable for 'Orte' See LSB 3.5
author Roland Geider <roland.geider@intevation.de>
date Mon, 15 Dec 2014 10:49:40 +0100
parents 4ac3eee22f96
children 83a98b61546a
files app/controller/Orte.js app/view/orte/List.js
diffstat 2 files changed, 22 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/app/controller/Orte.js	Sat Dec 13 14:12:52 2014 +0100
+++ b/app/controller/Orte.js	Mon Dec 15 10:49:40 2014 +0100
@@ -32,9 +32,9 @@
 
     addListeners: function() {
         this.control({
-            'ortelist': {
-                itemdblclick: this.editItem
-            },
+            //'ortelist': {
+            //    itemdblclick: this.editItem
+            //},
             'ortelist toolbar button[action=add]': {
                 click: this.addItem
             },
--- a/app/view/orte/List.js	Sat Dec 13 14:12:52 2014 +0100
+++ b/app/view/orte/List.js	Mon Dec 15 10:49:40 2014 +0100
@@ -25,6 +25,13 @@
     probeId: null,
 
     initComponent: function() {
+        var rowEditing = Ext.create('Ext.grid.plugin.RowEditing', {
+            clicksToMoveEditor: 1,
+            autoCancel: false
+        });
+        
+        this.plugins = [rowEditing];
+        
         this.store = Ext.data.StoreManager.get('Orte');
         if (!this.store) {
             this.store = Ext.create('Lada.store.Orte');
@@ -45,7 +52,10 @@
         }];
         this.columns = [{
             header: 'Typ',
-            dataIndex: 'ortsTyp'
+            dataIndex: 'ortsTyp',
+            editor: {
+                allowBlank: false
+            }
         }, {
             header: 'Staat',
             dataIndex: 'ortId',
@@ -76,7 +86,10 @@
                 var gemid = record.get('gemId');
                 var record2 = gemeinden.getById(gemid);
                 return record2.get('bezeichnung');
-            }
+            },
+            //editor: {
+            //    allowBlank: false
+            //}
         }, {
             header: 'Messpunkt',
             dataIndex: 'ortId',
@@ -84,7 +97,10 @@
                 var store = Ext.getStore('staOrte');
                 var record = store.getById(value);
                 return record.get('bezeichnung');
-            }
+            },
+            //editor: {
+            //    allowBlank: false
+            //}
         }];
         this.callParent(arguments);
     }

http://lada.wald.intevation.org