[Lada-commits] [PATCH] add action button in Messung grid and Ortszuordnung grid

Wald Commits scm-commit at wald.intevation.org
Mon Nov 21 08:08:00 CET 2016


# HG changeset patch
# User Michael Stanko <mstanko at bfs.de>
# Date 1479712074 -3600
# Node ID 9a428be3907b8a2db8d8392e295dc0fe851722a8
# Parent  f961f94495c899530e412ce6d2ec571981ea03d3
add action button in Messung grid and Ortszuordnung grid

diff -r f961f94495c8 -r 9a428be3907b app/view/grid/Messung.js
--- a/app/view/grid/Messung.js	Fri Nov 18 19:46:15 2016 +0100
+++ b/app/view/grid/Messung.js	Mon Nov 21 08:07:54 2016 +0100
@@ -45,6 +45,22 @@
             }]
         }];
         this.columns = [{
+            xtype: 'actioncolumn',
+            text: '',
+            dataIndex: 'readonly',
+            sortable: false,
+            width: 30,
+            getClass: function (val, meta, rec) {
+                if (rec.get('readonly') === false) {
+                        return 'edit';
+                }
+                return 'noedit';
+            },
+            handler: function(grid, rowIndex, colIndex) {
+                var rec = grid.getStore().getAt(rowIndex);
+                grid.fireEvent('itemdblclick', grid, rec);
+            }
+        }, {
             header: 'Nebenproben-Nr.',
             dataIndex: 'nebenprobenNr',
             flex: 1,
diff -r f961f94495c8 -r 9a428be3907b app/view/grid/Ortszuordnung.js
--- a/app/view/grid/Ortszuordnung.js	Fri Nov 18 19:46:15 2016 +0100
+++ b/app/view/grid/Ortszuordnung.js	Mon Nov 21 08:07:54 2016 +0100
@@ -46,6 +46,22 @@
             }]
         }];
         this.columns = [{
+            xtype: 'actioncolumn',
+            text: '',
+            dataIndex: 'readonly',
+            sortable: false,
+            width: 30,
+            getClass: function (val, meta, rec) {
+                if (rec.get('readonly') === false) {
+                        return 'edit';
+                }
+                return 'noedit';
+            },
+            handler: function(grid, rowIndex, colIndex) {
+                var rec = grid.getStore().getAt(rowIndex);
+                grid.fireEvent('itemdblclick', grid, rec);
+            }
+        }, {
             header: 'Typ',
             dataIndex: 'ortszuordnungTyp',
             flex: 1,
@@ -53,6 +69,15 @@
                 allowBlank: false
             }
         }, {
+            header: 'Ort-ID',
+            dataIndex: 'ortId',
+            flex: 2,
+            renderer: function(value) {
+                var store = Ext.data.StoreManager.get('orte');
+                var record = store.getById(value);
+                return record.get('ortId');
+            }
+        }, {
             header: 'Staat',
             dataIndex: 'ortId',
             flex: 1,
@@ -86,9 +111,14 @@
                 return record2.get('bezeichnung');
             }
         }, {
-            header: 'Ortszusatztext',
-            flex: 6,
-            dataIndex: 'ortszusatztext'
+            header: 'Anlage',
+            dataIndex: 'ortId',
+            flex: 3,
+            renderer: function(value) {
+                var store = Ext.data.StoreManager.get('orte');
+                var record = store.getById(value);
+                return record.get('anlageId');
+            }
         }];
         this.listeners = {
            select: {


More information about the Lada-commits mailing list