raimund@606: /* Copyright (C) 2013 by Bundesamt fuer Strahlenschutz raimund@606: * Software engineering by Intevation GmbH raimund@606: * raimund@606: * This file is Free Software under the GNU GPL (v>=3) raimund@606: * and comes with ABSOLUTELY NO WARRANTY! Check out raimund@606: * the documentation coming with IMIS-Labordaten-Application for details. raimund@606: */ raimund@606: raimund@606: /* raimund@606: * Window to edit a Messung raimund@606: */ raimund@606: Ext.define('Lada.view.window.OrtEdit', { raimund@606: extend: 'Ext.window.Window', raimund@606: alias: 'widget.ortedit', raimund@606: raimund@606: requires: [ raimund@606: 'Lada.view.panel.Map', raimund@606: 'Lada.view.form.Ort', raimund@606: 'Lada.view.form.Location' raimund@606: ], raimund@606: raimund@606: collapsible: true, raimund@606: maximizable: true, raimund@606: autoshow: true, raimund@606: layout: 'border', raimund@606: raimund@606: record: null, raimund@606: raimund@606: initComponent: function() { raimund@606: if (this.record === null) { raimund@606: Ext.Msg.alert('Kein valider Ort ausgewählt!'); raimund@606: this.callParent(arguments); raimund@606: return; raimund@606: } raimund@606: this.title = 'Ort'; raimund@606: this.buttons = [{ raimund@606: text: 'Schließen', raimund@606: scope: this, raimund@606: handler: this.close raimund@606: }]; raimund@606: this.width = 900; raimund@606: this.height = 515; raimund@606: this.bodyStyle = {background: '#fff'}; raimund@606: raimund@606: this.items = [{ raimund@606: region: 'west', raimund@606: border: 0, raimund@606: layout: 'vbox', raimund@606: items: [{ raimund@606: xtype: 'ortform', raimund@606: margin: 5, raimund@606: recordId: this.record.get('id') raimund@606: }, { raimund@606: xtype: 'locationform', raimund@606: margin: 5, raimund@606: recordId: this.record.get('id') raimund@606: }] raimund@606: }, { raimund@606: xtype: 'fset', raimund@606: bodyStyle: { raimund@606: background: '#fff' raimund@606: }, raimund@606: layout: 'border', raimund@606: name: 'mapfield', raimund@606: title: 'Karte', raimund@606: region: 'center', raimund@606: padding: '5, 5', raimund@606: margin: 5, raimund@606: items: [{ raimund@606: xtype: 'map', raimund@606: region: 'center', raimund@606: layout: 'border', raimund@614: record: this.record, raimund@606: bodyStyle: { raimund@606: background: '#fff' raimund@606: }, raimund@606: name: 'map' raimund@606: }] raimund@606: }]; raimund@606: this.callParent(arguments); raimund@606: }, raimund@606: raimund@606: initData: function() { raimund@606: this.down('ortform').setRecord(this.record); raimund@606: Ext.ClassManager.get('Lada.model.Location').load(this.record.get('ort'), { raimund@606: failure: function(record, action) { raimund@606: // TODO raimund@606: }, raimund@606: success: function(record, response) { raimund@606: this.down('locationform').setRecord(record); raimund@606: this.down('locationform').setReadOnly(true); raimund@606: }, raimund@606: scope: this raimund@606: }); raimund@606: }, raimund@606: raimund@606: setMessages: function(errors, warnings) { raimund@606: //todo this is a stub raimund@606: }, raimund@606: raimund@606: clearMessages: function() { raimund@606: //todo this is a stub raimund@606: } raimund@606: });