[Lada-commits] [PATCH 09 of 10] Added ort edit window
Wald Commits
scm-commit at wald.intevation.org
Thu Mar 12 15:52:41 CET 2015
# HG changeset patch
# User Raimund Renkert <raimund.renkert at intevation.de>
# Date 1426171984 -3600
# Node ID 2b2d284bd6e49e13c9bcaf98b0ea3f24f1cf33f3
# Parent c6994912a3267b72e22b05e809a80665b50f462e
Added ort edit window.
diff -r c6994912a326 -r 2b2d284bd6e4 app/view/window/OrtEdit.js
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/app/view/window/OrtEdit.js Thu Mar 12 15:53:04 2015 +0100
@@ -0,0 +1,103 @@
+/* Copyright (C) 2013 by Bundesamt fuer Strahlenschutz
+ * Software engineering by Intevation GmbH
+ *
+ * This file is Free Software under the GNU GPL (v>=3)
+ * and comes with ABSOLUTELY NO WARRANTY! Check out
+ * the documentation coming with IMIS-Labordaten-Application for details.
+ */
+
+/*
+ * Window to edit a Messung
+ */
+Ext.define('Lada.view.window.OrtEdit', {
+ extend: 'Ext.window.Window',
+ alias: 'widget.ortedit',
+
+ requires: [
+ 'Lada.view.panel.Map',
+ 'Lada.view.form.Ort',
+ 'Lada.view.form.Location'
+ ],
+
+ collapsible: true,
+ maximizable: true,
+ autoshow: true,
+ layout: 'border',
+
+ record: null,
+
+ initComponent: function() {
+ if (this.record === null) {
+ Ext.Msg.alert('Kein valider Ort ausgewählt!');
+ this.callParent(arguments);
+ return;
+ }
+ this.title = 'Ort';
+ this.buttons = [{
+ text: 'Schließen',
+ scope: this,
+ handler: this.close
+ }];
+ this.width = 900;
+ this.height = 515;
+ this.bodyStyle = {background: '#fff'};
+
+ this.items = [{
+ region: 'west',
+ border: 0,
+ layout: 'vbox',
+ items: [{
+ xtype: 'ortform',
+ margin: 5,
+ recordId: this.record.get('id')
+ }, {
+ xtype: 'locationform',
+ margin: 5,
+ recordId: this.record.get('id')
+ }]
+ }, {
+ xtype: 'fset',
+ bodyStyle: {
+ background: '#fff'
+ },
+ layout: 'border',
+ name: 'mapfield',
+ title: 'Karte',
+ region: 'center',
+ padding: '5, 5',
+ margin: 5,
+ items: [{
+ xtype: 'map',
+ region: 'center',
+ layout: 'border',
+ bodyStyle: {
+ background: '#fff'
+ },
+ name: 'map'
+ }]
+ }];
+ this.callParent(arguments);
+ },
+
+ initData: function() {
+ this.down('ortform').setRecord(this.record);
+ Ext.ClassManager.get('Lada.model.Location').load(this.record.get('ort'), {
+ failure: function(record, action) {
+ // TODO
+ },
+ success: function(record, response) {
+ this.down('locationform').setRecord(record);
+ this.down('locationform').setReadOnly(true);
+ },
+ scope: this
+ });
+ },
+
+ setMessages: function(errors, warnings) {
+ //todo this is a stub
+ },
+
+ clearMessages: function() {
+ //todo this is a stub
+ }
+});
More information about the Lada-commits
mailing list