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: dustin@891: /** dustin@875: * Window to create 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: dustin@875: probe: null, raimund@621: record: null, raimund@644: grid: null, raimund@621: dustin@890: /** dustin@890: * This function initialises the Window dustin@890: */ raimund@621: initComponent: function() { dustin@875: this.probe = this.record; dustin@875: if (this.probe === null) { dustin@875: Ext.Msg.alert('Zu der Messung existiert keine Probe!'); dustin@875: this.callParent(arguments); dustin@875: return; dustin@875: } dustin@875: dustin@875: var messstelle = Ext.data.StoreManager.get('messstellen') dustin@875: .getById(this.probe.get('mstId')); dustin@875: ehuber@1175: this.title = 'Neue Messung zu Probe - Hauptprobennr.: ' ehuber@1175: + this.probe.get('hauptprobenNr') dustin@875: + ' Mst: ' + messstelle.get('messStelle') dustin@875: + ' hinzufügen.'; dustin@875: 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: dustin@890: /** dustin@890: * Initialise the Data of this Window dustin@890: */ 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: dustin@890: /** dustin@890: * Instructs the fields / forms listed in this method to set a message. dustin@890: * @param errors These Errors shall be shown dustin@890: * @param warnings These Warning shall be shown dustin@890: */ raimund@621: setMessages: function(errors, warnings) { raimund@621: //todo this is a stub raimund@621: }, dustin@890: dustin@890: /** dustin@890: * Instructs the fields / forms listed in this method to clear their messages. dustin@890: */ raimund@621: clearMessages: function() { raimund@621: //todo this is a stub dustin@707: }, dustin@707: dustin@890: /** dustin@890: * Disable the Childelements of this Window dustin@890: */ dustin@707: disableChildren: function(){ dustin@707: //intentionally! dustin@707: return true; dustin@707: }, dustin@707: dustin@890: /** dustin@890: * Enable the Childelements of this Window dustin@890: */ dustin@707: enableChildren: function(){ dustin@707: //intentionally! dustin@707: return true; dustin@1027: }, dustin@1027: dustin@1027: /** dustin@1027: * Enable to reset the statusgrid dustin@1027: */ dustin@1027: enableStatusReset: function() { dustin@1027: //intentionally! dustin@1027: return true; dustin@1027: }, dustin@1027: dustin@1027: /** dustin@1027: * Disable to reset the statusgrid dustin@1027: */ dustin@1027: disableStatusReset: function() { dustin@1027: //intentionally! dustin@1027: return true; dustin@1027: }, dustin@1027: /** dustin@1027: * Enable to edit the statusgrid dustin@1027: */ dustin@1027: enableStatusEdit: function() { dustin@1027: //intentionally! dustin@1027: return true; dustin@1027: }, dustin@1027: dustin@1027: /** dustin@1027: * Disable to edit the statusgrid dustin@1027: */ dustin@1027: disableStatusEdit: function() { dustin@1027: //intentionally! dustin@1027: return true; dustin@1027: } raimund@621: });