torsten@472: /* Copyright (C) 2013 by Bundesamt fuer Strahlenschutz torsten@472: * Software engineering by Intevation GmbH torsten@472: * torsten@472: * This file is Free Software under the GNU GPL (v>=3) torsten@472: * and comes with ABSOLUTELY NO WARRANTY! Check out raimund@497: * the documentation coming with IMIS-Labordaten-Application for details. torsten@472: */ torsten@472: raimund@446: /** raimund@446: * raimund@446: */ raimund@446: Ext.define('Lada.view.orte.CreateOrt', { raimund@446: extend: 'Ext.window.Window', raimund@446: alias: 'widget.createortdetail', raimund@497: raimund@498: requires: [ raimund@498: 'Lada.view.widgets.Staat', raimund@498: 'Lada.view.widgets.Verwaltungseinheit' raimund@498: ], raimund@498: raimund@446: title: 'Neuer Ort', raimund@446: raimund@446: /** raimund@446: * @private raimund@446: * Initialize the view. raimund@446: */ raimund@446: initComponent: function() { raimund@446: var me = this; raimund@446: raimund@446: var form = Ext.create('Ext.form.Panel', { raimund@446: items: [{ raimund@446: xtype: 'textfield', raimund@446: maxLength: 100, raimund@446: name: 'ort_beschreibung', raimund@446: fieldLabel: 'Beschreibung' raimund@491: }, { raimund@446: xtype: 'staat', raimund@446: name: 'ort_staatId', raimund@446: fieldLabel: 'Staat' raimund@491: }, { raimund@446: xtype: 'verwaltungseinheiten', raimund@446: name: 'ort_gemId', raimund@450: fieldLabel: 'Gemeinde', raimund@450: listeners: { raimund@450: 'select': { raimund@450: scope: me, raimund@497: fn: function(field, newValue) { raimund@450: var lon = field.up('window').down( raimund@450: 'numberfield[name=ort_longitude]'); raimund@450: var lat = field.up('window').down( raimund@450: 'numberfield[name=ort_latitude]'); raimund@450: lon.setValue(newValue[0].data.longitude); raimund@450: lat.setValue(newValue[0].data.latitude); raimund@450: } raimund@450: } raimund@450: } raimund@491: }, { raimund@446: xtype: 'numberfield', raimund@446: name: 'ort_latitude', raimund@446: fieldLabel: 'Lat' raimund@491: }, { raimund@446: xtype: 'numberfield', raimund@446: name: 'ort_longitude', raimund@446: fieldLabel: 'Lon' raimund@491: }, { raimund@446: xtype: 'numberfield', raimund@446: name: 'ort_hoeheLand', raimund@446: fieldLabel: 'Höhe' raimund@446: }] raimund@446: }); raimund@446: raimund@446: me.items = [form]; raimund@491: this.buttons = [{ raimund@491: text: 'Speichern', raimund@491: scope: form, raimund@491: action: 'save' raimund@491: }, { raimund@491: text: 'Abbrechen', raimund@491: scope: this, raimund@491: handler: this.close raimund@491: }]; raimund@446: this.callParent(arguments); raimund@446: } raimund@446: });