changeset 1107:9bcd17f7a0ae

change some fields in probeform to combobox
author Michael Stanko <mstanko@bfs.de>
date Thu, 12 May 2016 16:03:04 +0200
parents ecce10cf32dc
children 7baaf2cd3f57
files app.js app/view/form/Probe.js app/view/widget/DatensatzErzeuger.js app/view/widget/MessprogrammLand.js app/view/widget/Probenehmer.js
diffstat 5 files changed, 151 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/app.js	Thu May 12 11:08:26 2016 +0200
+++ b/app.js	Thu May 12 16:03:04 2016 +0200
@@ -53,6 +53,9 @@
         'Lada.store.Verwaltungseinheiten',
         'Lada.store.StatusWerte',
         'Lada.store.StatusStufe',
+        'Lada.store.Probenehmer',
+        'Lada.store.DatensatzErzeuger',
+        'Lada.store.MessprogrammKategorie',
         'Lada.model.MessstelleLabor'
     ],
     bundle: {
@@ -198,6 +201,15 @@
         Ext.create('Lada.store.Verwaltungseinheiten', {
             storeId: 'verwaltungseinheiten'
         });
+        Ext.create('Lada.store.Probenehmer', {
+            storeId: 'probenehmer'
+        });
+        Ext.create('Lada.store.DatensatzErzeuger', {
+            storeId: 'datensatzerzeuger'
+        });
+        Ext.create('Lada.store.MessprogrammKategorie', {
+            storeId: 'messprogrammkategorie'
+        });
         Ext.create('Lada.store.StatusWerte', {
             storeId: 'statuswerte',
             autoLoad: true
--- a/app/view/form/Probe.js	Thu May 12 11:08:26 2016 +0200
+++ b/app/view/form/Probe.js	Thu May 12 16:03:04 2016 +0200
@@ -14,6 +14,9 @@
     alias: 'widget.probeform',
     requires: [
         'Lada.view.widget.Datenbasis',
+        'Lada.view.widget.DatensatzErzeuger',
+        'Lada.view.widget.Probenehmer',
+        'Lada.view.widget.MessprogrammLand',
         'Lada.view.widget.base.CheckBox',
         'Lada.view.widget.MessstelleLabor',
         'Lada.view.widget.Netzbetreiber',
@@ -185,7 +188,7 @@
                             border: 0,
                             width: '100%',
                             items: [{
-                                xtype: 'numberfield',
+                                xtype: 'probenehmer',
                                 allowDecimals: false,
                                 name: 'probeNehmerId',
                                 fieldLabel: 'Probennehmer',
@@ -195,14 +198,22 @@
                                 anchor: '100%',
                                 labelWidth: 95
                             }, {
-                                xtype: 'tfield',
-                                name: 'x11',
+                                xtype: 'datensatzerzeuger',
+                                name: 'erzeugerId',
                                 fieldLabel: 'Datensatzerzeuger',
                                 margin: '0, 5, 5, 5',
                                 width: '50%',
                                 anchor: '100%',
                                 labelWidth: 110
                             }]
+                        },{
+                            xtype: 'messprogrammland',
+                            name: 'mplId',
+                            fieldLabel: 'Messprogramm-Land',
+                            margin: '0, 5, 5, 5',
+                            width: '50%',
+                            anchor: '100%',
+                            labelWidth: 110
                         }]
                 }, {
                     // Zeit
@@ -467,7 +478,7 @@
         this.down('chkbox[name=test]').clearWarningOrError();
         this.down('cbox[name=probenartId]').clearWarningOrError();
         this.down('cbox[name=netzbetreiberId]').clearWarningOrError();
-        this.down('tfield[name=x11]').clearWarningOrError();
+        this.down('cbox[name=erzeugerId]').clearWarningOrError();
         this.down('cbox[name=umwId]').clearWarningOrError();
         this.down('datetime[name=probeentnahmeBeginn]').clearWarningOrError();
         this.down('datetime[name=probeentnahmeEnde]').clearWarningOrError();
@@ -482,11 +493,11 @@
         this.down('cbox[name=baId]').setReadOnly(value);
         this.down('chkbox[name=test]').setReadOnly(value);
         this.down('cbox[name=probenartId]').setReadOnly(value);
-        this.down('tfield[name=x11]').setReadOnly(value);
+        this.down('cbox[name=erzeugerId]').setReadOnly(value);
         this.down('cbox[name=umwId]').setReadOnly(value);
         this.down('datetime[name=probeentnahmeBeginn]').setReadOnly(value);
         this.down('datetime[name=probeentnahmeEnde]').setReadOnly(value);
-        this.down('numberfield[name=probeNehmerId]').setReadOnly(value);
+        this.down('cbox[name=probeNehmerId]').setReadOnly(value);
 
         //Deskriptoren
         for (var i = 0; i < 12; i++) {
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/app/view/widget/DatensatzErzeuger.js	Thu May 12 16:03:04 2016 +0200
@@ -0,0 +1,43 @@
+/* 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.
+ */
+
+/**
+ * Combobox for Umweltbereich
+ */
+Ext.define('Lada.view.widget.DatensatzErzeuger' ,{
+    extend: 'Lada.view.widget.base.ComboBox',
+    alias: 'widget.datensatzerzeuger',
+    store: 'datensatzerzeuger',
+    displayField: 'id',
+    valueField: 'id',
+    editable: this.editable || false,
+    forceSelection: true,
+    // Enable filtering of comboboxes
+    autoSelect: false,
+    queryMode: 'local',
+    triggerAction: 'all',
+    typeAhead: false,
+    minChars: 0,
+    tpl: Ext.create("Ext.XTemplate",
+        '<tpl for="."><div class="x-combo-list-item  x-boundlist-item" >' +
+            '{id} - {datensatzErzeuger}</div></tpl>'),
+    displayTpl: Ext.create('Ext.XTemplate',
+         '<tpl for=".">{id} - {datensatzErzeuger}</tpl>'),
+
+    initComponent: function() {
+        var i18n = Lada.getApplication().bundle;
+        this.emptyText = i18n.getMsg('emptytext.datensatzerzeuger');
+
+        this.store = Ext.data.StoreManager.get('datensatz_erzeuger');
+        if (!this.store) {
+            this.store = Ext.create('Lada.store.DatensatzErzeuger');
+        }
+        this.store.sort();
+        this.callParent(arguments);
+    }
+});
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/app/view/widget/MessprogrammLand.js	Thu May 12 16:03:04 2016 +0200
@@ -0,0 +1,36 @@
+/* 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.
+ */
+
+/**
+ * Combobox for MessprogrammLand
+ */
+Ext.define('Lada.view.widget.MessprogrammLand', {
+    extend: 'Lada.view.widget.base.ComboBox',
+    alias: 'widget.messprogrammland',
+    store: 'messprogrammkategorie',
+    displayField: 'display',
+    valueField: 'id',
+    emptyText: 'Wählen Sie eine Landesmessprogramm',
+    // Enable filtering of comboboxes
+    queryMode: 'local',
+    triggerAction: 'all',
+    typeAhead: true,
+    minChars: 0,
+    layout: 'hbox',
+
+    initComponent: function() {
+        this.store = Ext.data.StoreManager.get('messprogrammkategorie');
+        if (!this.store) {
+            this.store = Ext.create('Lada.store.MessprogrammKategorie');
+        }
+        else {
+            this.store.clearFilter();
+        }
+        this.callParent(arguments);
+    }
+});
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/app/view/widget/Probenehmer.js	Thu May 12 16:03:04 2016 +0200
@@ -0,0 +1,43 @@
+/* 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.
+ */
+
+/**
+ * Combobox for Umweltbereich
+ */
+Ext.define('Lada.view.widget.Probenehmer' ,{
+    extend: 'Lada.view.widget.base.ComboBox',
+    alias: 'widget.probenehmer',
+    store: 'Probenehmer',
+    displayField: 'id',
+    valueField: 'id',
+    editable: this.editable || false,
+    forceSelection: true,
+    // Enable filtering of comboboxes
+    autoSelect: false,
+    queryMode: 'local',
+    triggerAction: 'all',
+    typeAhead: false,
+    minChars: 0,
+    tpl: Ext.create("Ext.XTemplate",
+        '<tpl for="."><div class="x-combo-list-item  x-boundlist-item" >' +
+            '{id} - {probeNehmer}</div></tpl>'),
+    displayTpl: Ext.create('Ext.XTemplate',
+         '<tpl for=".">{id} - {probeNehmer}</tpl>'),
+
+    initComponent: function() {
+        var i18n = Lada.getApplication().bundle;
+        this.emptyText = i18n.getMsg('emptytext.probenehmer');
+
+        this.store = Ext.data.StoreManager.get('probenehmer');
+        if (!this.store) {
+            this.store = Ext.create('Lada.store.Probenehmer');
+        }
+        this.store.sort();
+        this.callParent(arguments);
+    }
+});

http://lada.wald.intevation.org