[Lada-commits] [PATCH 2 of 4] Removed Detail Button from MessungenGrid, Added Operation in Messungengrid controller to open a detailed view after a doubleclick

Wald Commits scm-commit at wald.intevation.org
Tue Mar 10 15:32:51 CET 2015


# HG changeset patch
# User Dustin Demuth <dustin at intevation.de>
# Date 1425998095 -3600
# Node ID 5af82dc8612d7fd3247a2a6bb537e734c369c235
# Parent  0d4137e0fe3608c288d186d5a82565179077dd11
Removed Detail Button from MessungenGrid, Added Operation in Messungengrid controller to open a detailed view after a doubleclick.

diff -r 0d4137e0fe36 -r 5af82dc8612d app/controller/MessungenGrid.js
--- a/app/controller/MessungenGrid.js	Tue Mar 10 15:26:47 2015 +0100
+++ b/app/controller/MessungenGrid.js	Tue Mar 10 15:34:55 2015 +0100
@@ -12,14 +12,14 @@
 Ext.define('Lada.controller.MessungenGrid', {
     extend: 'Ext.app.Controller',
 
+    requires: [
+        'Lada.view.window.MessungEdit'
+    ],
+
     init: function() {
         this.control({
             'messungengrid': {
-                selectionchange: this.selectionChanged,
-                edit: this.gridSave
-            },
-            'messungengrid button[action=open]': {
-                click: this.open
+                itemdblclick: this.open
             },
             'messungengrid button[action=add]': {
                 click: this.add
@@ -48,9 +48,15 @@
         });
     },
 
-    open: function() {
+    open: function(grid, record) {
+        //Opens a detailed view of the Messung
+        var win = Ext.create('Lada.view.window.MessungEdit', {
+            record: this.record
+        });
+        win.show();
+        win.initData();
         // todo
-        console.log('open');
+        console.log('opened window');
     },
 
     add: function() {
diff -r 0d4137e0fe36 -r 5af82dc8612d app/view/grid/Messungen.js
--- a/app/view/grid/Messungen.js	Tue Mar 10 15:26:47 2015 +0100
+++ b/app/view/grid/Messungen.js	Tue Mar 10 15:34:55 2015 +0100
@@ -32,16 +32,10 @@
             autoCancel: false,
             itemId: 'rowedit'
         });
-        this.plugins = [rowEditing];
         this.dockedItems = [{
             xtype: 'toolbar',
             dock: 'bottom',
             items: ['->', {
-                text: 'Details',
-                icon: 'resources/img/document-open.png',
-                action: 'open',
-                disabled: true
-            }, {
                 text: 'Hinzufügen',
                 icon: 'resources/img/list-add.png',
                 action: 'add',
@@ -56,16 +50,10 @@
             header: 'Mess-ID',
             dataIndex: 'id',
             flex: 1,
-            editor: {
-                allowBlank: false
-            }
         }, {
             header: 'Nebenproben-Nr.',
             dataIndex: 'nebenprobenNr',
             flex: 1,
-            editor: {
-                allowBlank: false
-            }
         }, {
             header: 'MMT',
             dataIndex: 'mmtId',
@@ -77,14 +65,6 @@
             header: 'Messzeit',
             dataIndex: 'messzeitpunkt',
             flex: 2,
-            editor: {
-                xtype: 'datefield',
-                allowBlank: false,
-                format: 'd.m.Y',
-                //minValue: '01.01.2001', //todo: gibt es das?
-                //minText: 'Das Datum der Messung darf nicht vor dem 01.01.2001 liegen.',
-                maxValue: Ext.Date.format(new Date(), 'd.m.Y')
-            }
         }, {
             header: 'Status',
             flex: 1,
@@ -172,6 +152,9 @@
         this.store.load({
             params: {
                 probeId: this.recordId
+            },
+            success: function(record, response){
+               console.log(Ext.getClassName(response));
             }
         });
     }


More information about the Lada-commits mailing list