raimund@621: /* Copyright (C) 2013 by Bundesamt fuer Strahlenschutz
raimund@621:  * Software engineering by Intevation GmbH
raimund@621:  *
raimund@621:  * This file is Free Software under the GNU GPL (v>=3)
raimund@621:  * and comes with ABSOLUTELY NO WARRANTY! Check out
raimund@621:  * the documentation coming with IMIS-Labordaten-Application for details.
raimund@621:  */
raimund@621: 
raimund@621: /*
raimund@621:  * Window to edit a Messung
raimund@621:  */
raimund@621: Ext.define('Lada.view.window.MessungCreate', {
raimund@621:     extend: 'Ext.window.Window',
raimund@621:     alias: 'widget.messungcreate',
raimund@621: 
raimund@621:     requires: [
raimund@621:       'Lada.view.form.Messung'
raimund@621:     ],
raimund@621: 
raimund@621:     collapsible: true,
raimund@621:     maximizable: true,
raimund@621:     autoshow: true,
raimund@621:     autoscroll: true,
raimund@621:     layout: 'fit',
dustin@688:     constrain: true,
raimund@621: 
raimund@621:     record: null,
raimund@644:     grid: null,
raimund@621: 
raimund@621:     initComponent: function() {
raimund@621:         this.title = 'Messung';
raimund@621:         this.buttons = [{
raimund@621:             text: 'Schließen',
raimund@621:             scope: this,
raimund@621:             handler: this.close
raimund@621:         }];
raimund@621:         this.width = 700;
raimund@621: 
dustin@709:         // add listeners to change the window appearence when it becomes inactive
dustin@709:         this.on({
dustin@709:             activate: function(){
dustin@709:                 this.getEl().removeCls('window-inactive');
dustin@709:             },
dustin@709:             deactivate: function(){
dustin@709:                 this.getEl().addCls('window-inactive');
dustin@709:             }
dustin@709:         });
dustin@709: 
raimund@621:         this.items = [{
raimund@621:             border: 0,
raimund@621:             autoScroll: true,
raimund@621:             items: [{
raimund@621:                 xtype: 'messungform'
raimund@621:            }]
raimund@621:         }];
raimund@621:         this.callParent(arguments);
raimund@621:     },
raimund@621: 
raimund@621:     initData: function() {
raimund@621:         this.clearMessages();
raimund@621:         var messung = Ext.create('Lada.model.Messung', {
raimund@621:             probeId: this.record.get('id')
raimund@621:         });
raimund@621:         this.down('messungform').setRecord(messung);
raimund@621:     },
raimund@621: 
raimund@621:     setMessages: function(errors, warnings) {
raimund@621:         //todo this is a stub
raimund@621:     },
raimund@621:     clearMessages: function() {
raimund@621:         //todo this is a stub
dustin@707:     },
dustin@707: 
dustin@707:     disableChildren: function(){
dustin@707:         //intentionally!
dustin@707:         return true;
dustin@707:     },
dustin@707: 
dustin@707:     enableChildren: function(){
dustin@707:         //intentionally!
dustin@707:         return true;
raimund@621:     }
raimund@621: });