[Lada-commits] [PATCH 3 of 6] Make tables editable for 'Status'

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


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

See LSB 3.5

diff -r de1acaf21db3 -r 6ad453afbc31 app/controller/Status.js
--- a/app/controller/Status.js	Tue Dec 16 15:58:43 2014 +0100
+++ b/app/controller/Status.js	Tue Dec 16 16:20:15 2014 +0100
@@ -23,9 +23,9 @@
 
     addListeners: function() {
         this.control({
-            'statuslist': {
-                itemdblclick: this.editItem
-            },
+            //'statuslist': {
+            //    itemdblclick: this.editItem
+            //},
             'statuslist toolbar button[action=add]': {
                 click: this.addItem
             },
diff -r de1acaf21db3 -r 6ad453afbc31 app/view/status/List.js
--- a/app/view/status/List.js	Tue Dec 16 15:58:43 2014 +0100
+++ b/app/view/status/List.js	Tue Dec 16 16:20:15 2014 +0100
@@ -27,6 +27,11 @@
     probeId: 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,17 +49,32 @@
         }];
         this.columns = [{
             header: 'Erzeuger',
-            dataIndex: 'erzeuger'
+            dataIndex: 'erzeuger',
+            editor: {
+                allowBlank: false
+            }
         }, {
             header: 'Status',
-            dataIndex: 'status'
+            dataIndex: 'status',
+            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: 'kommentar',
-            flex: 1
+            flex: 1,
+            editor: {
+                allowBlank: true
+            }
         }];
         this.callParent(arguments);
     }


More information about the Lada-commits mailing list