changeset 579:50c05b1b085f

merged
author Dustin Demuth <dustin@intevation.de>
date Tue, 10 Mar 2015 15:50:03 +0100
parents bbe610be91cc (current diff) 5af82dc8612d (diff)
children fe074c2250b4
files
diffstat 3 files changed, 110 insertions(+), 27 deletions(-) [+]
line wrap: on
line diff
--- a/app/controller/MessungenGrid.js	Tue Mar 10 15:48:34 2015 +0100
+++ b/app/controller/MessungenGrid.js	Tue Mar 10 15:50:03 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:48:34 2015 +0100
+++ b/app/view/grid/Messungen.js	Tue Mar 10 15:50:03 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));
             }
         });
     }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/app/view/window/MessungEdit.js	Tue Mar 10 15:50:03 2015 +0100
@@ -0,0 +1,94 @@
+/* Copyright (C) 2013 by Bundesamt fuer Strahlenschutz
+ * Software engineering by Intevation GmbH
+ *
+ * This file is Free Software under the GNU GPL (v>=3)
+ * and comes with ABSOLUTELY NO WARRANTY! Check out
+ * the documentation coming with IMIS-Labordaten-Application for details.
+ */
+
+/*
+ * Window to edit a Messung 
+ */
+Ext.define('Lada.view.window.MessungEdit', {
+    extend: 'Ext.window.Window',
+    alias: 'widget.messungedit',
+
+   // requires: [
+   //   'Lada.view.form.Messung',
+   //   'Lada.view.grid.Messwert',
+   //   'Lada.view.grid.Messstatus',
+   //   'Lada.view.grid.MKommentar'
+   // ],
+
+    collapsible: true,
+    maximizable: true,
+    autoshow: true,
+    autoscroll: true,
+    layout: 'fit',
+
+    record: null,
+
+    initComponent: function(){
+        if (this.record === null) {
+            Ext.Msg.alert('Keine valide Messung ausgewählt!');
+            this.callParent(arguments);
+            return;
+        }
+        this.title = 'Messung ';// + this.record.get('messungId');
+        this.buttons = [{
+            text: 'Schließen',
+            scope: this,
+            handler: this.close
+        }];
+        this.width = 700;
+        this.height = Ext.getBody().getViewSize().height - 30;
+
+        this.items = [{
+            border: 0,
+            autoScroll: true,
+            items: [{
+         //       xtype: 'messungform',
+//                recordId: record.get('id')
+            }, {
+                xtype: 'fset',
+                name: 'messwerte',
+                title: 'Messwerte - Stub'
+                //todo
+            }, {
+                xtype: 'fset',
+                name: 'messungstatus',
+                title: 'Messungstatus - Stub'
+                //todo 
+           }, {
+                xtype: 'fset',
+                name: 'messungskommentare',
+                title: 'Messungskommentare - Stub'
+                //todo
+           }]
+        }];
+        this.callParent(arguments);
+    },
+
+    initData: function() {
+        this.clearMessages();
+        Ext.ClassManager.get('Lada.model.Messung').load(this.record.get('id'), {
+            failure: function(record, action){
+                // todo
+                console.log("failure");
+            },
+            success: function(record, action){
+                console.log("success");
+            },
+            scope: this
+        }
+        );
+    },
+
+    setMessages: function(errors, warnings) {
+        //todo this is a stub
+    },
+    clearMessages: function() {
+        //todo this is a stub
+    }
+
+});

http://lada.wald.intevation.org