dustin@757: /* Copyright (C) 2013 by Bundesamt fuer Strahlenschutz dustin@757: * Software engineering by Intevation GmbH dustin@757: * dustin@757: * This file is Free Software under the GNU GPL (v>=3) dustin@757: * and comes with ABSOLUTELY NO WARRANTY! Check out dustin@757: * the documentation coming with IMIS-Labordaten-Application for details. dustin@757: */ dustin@757: dustin@757: /* dustin@757: * Window to create a Messprogramm dustin@757: * dustin@757: */ dustin@757: Ext.define('Lada.view.window.MessprogrammCreate', { dustin@757: extend: 'Ext.window.Window', dustin@757: alias: 'widget.messprogrammcreate', dustin@757: dustin@757: requires: [ dustin@757: 'Lada.view.form.Messprogramm' dustin@757: ], dustin@757: dustin@757: collapsible: true, dustin@757: maximizable: true, dustin@757: autoShow: true, dustin@757: autoScroll: true, dustin@757: layout: 'fit', dustin@757: constrain: true, dustin@757: dustin@757: record: null, dustin@757: dustin@757: initComponent: function() { dustin@757: var i18n = Lada.getApplication().bundle; dustin@757: this.title = i18n.getMsg('messprogramm.window.create.title'); dustin@757: this.buttons = [{ dustin@757: text: i18n.getMsg('close'), dustin@757: scope: this, dustin@757: handler: this.close dustin@757: }]; dustin@757: dustin@757: // add listeners to change the window appearence when it becomes inactive dustin@757: this.on({ dustin@757: activate: function(){ dustin@757: this.getEl().removeCls('window-inactive'); dustin@757: }, dustin@757: deactivate: function(){ dustin@757: this.getEl().addCls('window-inactive'); dustin@757: } dustin@757: }); dustin@757: dustin@757: this.width = 700; dustin@757: this.height = Ext.getBody().getViewSize().height - 30; dustin@757: // InitialConfig is the config object passed to the constructor on dustin@757: // creation of this window. We need to pass it throuh to the form as dustin@757: // we need the "modelId" param to load the correct item. dustin@757: dustin@757: this.items = [{ dustin@757: border: 0, dustin@757: autoScroll: true, dustin@757: items: [{ dustin@757: xtype: 'messprogrammform' dustin@757: }, { dustin@757: //Messmethoden dustin@757: xtype: 'fieldset', dustin@757: title: i18n.getMsg('mmtmessprogramm.form.fieldset.title'), dustin@757: autoScroll: true, dustin@757: margin: 5, dustin@757: layout: { dustin@757: type: 'hbox', dustin@757: }, dustin@757: items: [{ dustin@757: xtype: 'messmethodengrid', dustin@757: flex: 1 dustin@757: }, { dustin@757: xtype: 'messmethodengrid', dustin@757: flex: 1 dustin@757: }] dustin@757: }] dustin@757: }]; dustin@757: this.callParent(arguments); dustin@757: }, dustin@757: dustin@757: initData: function() { dustin@757: var record = Ext.create('Lada.model.Messprogramm'); dustin@757: this.down('messprogrammform').setRecord(record); dustin@757: }, dustin@757: dustin@757: setMessages: function(errors, warnings) { dustin@757: this.down('messprogrammform').setMessages(errors, warnings); dustin@757: }, dustin@757: dustin@757: clearMessages: function() { dustin@757: this.down('messprogrammform').clearMessages(); dustin@757: }, dustin@757: dustin@757: disableChildren: function(){ dustin@757: //intentionally! dustin@757: return true; dustin@757: }, dustin@757: dustin@757: enableChildren: function(){ dustin@757: //intentionally! dustin@757: return true; dustin@757: } dustin@757: });