# HG changeset patch # User Dustin Demuth # Date 1425999003 -3600 # Node ID 50c05b1b085ffbe9c32172cc7cfef8a6ba8f395c # Parent bbe610be91ccdf11d7b9e525825cd265221c1428# Parent 5af82dc8612d7fd3247a2a6bb537e734c369c235 merged diff -r bbe610be91cc -r 50c05b1b085f app/controller/MessungenGrid.js --- 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() { diff -r bbe610be91cc -r 50c05b1b085f app/view/grid/Messungen.js --- 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)); } }); } diff -r bbe610be91cc -r 50c05b1b085f app/view/window/MessungEdit.js --- /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 + } + +});