diff app/view/window/Ortszuordnung.js @ 1013:75ce503ab296 stammdatengrids

Added a Ortszuordnungwindow and Form
author Dustin Demuth <dustin@intevation.de>
date Tue, 26 Jan 2016 12:29:59 +0100
parents
children 1df6b6210b42
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/app/view/window/Ortszuordnung.js	Tue Jan 26 12:29:59 2016 +0100
@@ -0,0 +1,121 @@
+/* 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 create/edit the Ort / Probe Relation
+ */
+Ext.define('Lada.view.window.Ortszuordnung', {
+    extend: 'Ext.window.Window',
+    alias: 'widget.ortszuordnungwindow',
+
+    requires: [
+        'Lada.view.form.Ortszuordnung'
+    ],
+
+    collapsible: true,
+    maximizable: true,
+    autoshow: true,
+    layout: 'border',
+    constrain: true,
+
+    probe: null,
+    parentWindow: null,
+    record: null,
+    grid: null,
+
+    /**
+     * This function initialises the Window
+     */
+    initComponent: function() {
+        var i18n = Lada.getApplication().bundle;
+
+        this.title = i18n.getMsg('ortszuordnung.window.title');
+
+        if (this.record && this.probe) {
+            // A new record will be created
+            this.title = i18n.getMsg('ortszuordnung.window.title')
+                            + ' '
+                            + i18n.getMsg('ortszuordnung.window.title2')
+                            + ' '
+                            + i18n.getMsg('probe')
+                            + ' '
+                            + probe.get('hauptprobennr')
+                            + ' '
+                            + i18n.getMsg('edit');
+        }
+        else if (this.probe) {
+            // A new record will be created
+            this.title = i18n.getMsg('ortszuordnung.window.title')
+                            + ' '
+                            + i18n.getMsg('ortszuordnung.window.title2')
+                            + ' '
+                            + i18n.getMsg('probe')
+                            + ' '
+                            + probe.get('hauptprobennr')
+                            + ' '
+                            + i18n.getMsg('create');
+        }
+
+        this.buttons = [{
+            text: i18n.getMsg('close'),
+            scope: this,
+            handler: this.close
+        }];
+        this.width = 900;
+        this.height = 515;
+        this.bodyStyle = {background: '#fff'};
+
+        // add listeners to change the window appearence when it becomes inactive
+        this.on({
+            activate: function(){
+                this.getEl().removeCls('window-inactive');
+            },
+            deactivate: function(){
+                this.getEl().addCls('window-inactive');
+            }
+        });
+
+        this.items = [{
+            region: 'west',
+            border: 0,
+            layout: 'hbox',
+            items: [{
+                xtype: 'ortszuordnungform',
+                margin: 5
+            //}, {
+            //    xtype: 'ortpanel',
+            //    margin: 5
+            }]
+        }];
+        this.callParent(arguments);
+    },
+
+    /**
+     * Initialise the Data of this Window
+     */
+    initData: function() {
+        this.down('ortszuordnungform').setRecord(this.record);
+    },
+
+    /**
+     * Instructs the fields / forms listed in this method to set a message.
+     * @param errors These Errors shall be shown
+     * @param warnings These Warning shall be shown
+     */
+    setMessages: function(errors, warnings) {
+        //todo this is a stub
+    },
+
+    /**
+     * Instructs the fields / forms listed in this method to clear their messages.
+     */
+    clearMessages: function() {
+        //todo this is a stub
+    }
+});
+

http://lada.wald.intevation.org