changeset 577:5af82dc8612d

Removed Detail Button from MessungenGrid, Added Operation in Messungengrid controller to open a detailed view after a doubleclick.
author Dustin Demuth <dustin@intevation.de>
date Tue, 10 Mar 2015 15:34:55 +0100
parents 0d4137e0fe36
children 50c05b1b085f
files app/controller/MessungenGrid.js app/view/grid/Messungen.js
diffstat 2 files changed, 16 insertions(+), 27 deletions(-) [+]
line wrap: on
line diff
--- 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() {
--- 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));
             }
         });
     }

http://lada.wald.intevation.org