[Lada-commits] [PATCH 4 of 6] Make tables editable for 'MKommentare'

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


# HG changeset patch
# User Roland Geider <roland.geider at intevation.de>
# Date 1418743242 -3600
# Node ID 8972f008dfb1ffa1dcb821fa985f730286a63834
# Parent  6ad453afbc31fafab6212e63ef7c3758edbd0faf
Make tables editable for 'MKommentare'

See LSB 3.5

diff -r 6ad453afbc31 -r 8972f008dfb1 app/controller/MKommentare.js
--- a/app/controller/MKommentare.js	Tue Dec 16 16:20:15 2014 +0100
+++ b/app/controller/MKommentare.js	Tue Dec 16 16:20:42 2014 +0100
@@ -30,9 +30,9 @@
 
     addListeners: function() {
         this.control({
-            'mkommentarelist': {
-                itemdblclick: this.editItem
-            },
+            //'mkommentarelist': {
+            //    itemdblclick: this.editItem
+            //},
             'mkommentarelist toolbar button[action=add]': {
                 click: this.addItem
             },
diff -r 6ad453afbc31 -r 8972f008dfb1 app/view/mkommentare/List.js
--- a/app/view/mkommentare/List.js	Tue Dec 16 16:20:15 2014 +0100
+++ b/app/view/mkommentare/List.js	Tue Dec 16 16:20:42 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,14 +51,26 @@
         }];
         this.columns = [{
             header: 'Erzeuger',
-            dataIndex: 'erzeuger'
+            dataIndex: 'erzeuger',
+            editor: {
+                allowBlank: false
+            }
         }, {
             header: 'Datum',
-            dataIndex: 'datum'
+            dataIndex: 'datum',
+            editor: {
+                xtype: 'datefield',
+                allowBlank: false,
+                format: 'd.m.Y',
+                maxValue: Ext.Date.format(new Date(), 'd.m.Y')
+            }
         }, {
             header: 'Text',
             dataIndex: 'text',
-            flex: 1
+            flex: 1,
+            editor: {
+                allowBlank: false
+            }
         }];
         this.callParent(arguments);
     }


More information about the Lada-commits mailing list