[Lada-commits] [PATCH 2 of 2] Refactored proben edit window

Wald Commits scm-commit at wald.intevation.org
Thu Dec 11 18:56:31 CET 2014


# HG changeset patch
# User Raimund Renkert <raimund.renkert at intevation.de>
# Date 1418320461 -3600
# Node ID 369917727c862f86946f728f4c456761fc86b42d
# Parent  484e12e89d54037a05d6e1e89c635f7a82e19e91
Refactored proben edit window.

diff -r 484e12e89d54 -r 369917727c86 app/view/proben/Edit.js
--- a/app/view/proben/Edit.js	Thu Dec 11 18:53:29 2014 +0100
+++ b/app/view/proben/Edit.js	Thu Dec 11 18:54:21 2014 +0100
@@ -23,6 +23,7 @@
     autoShow: true,
     autoScroll: true,
     modal: true,
+    layout: 'fit',
 
     initComponent: function() {
         this.buttons = [{
@@ -33,14 +34,108 @@
             scope: this,
             handler: this.close
         }];
-        this.width = Ext.getBody().getViewSize().width - 30;
+        this.width = 700// Ext.getBody().getViewSize().width - 30;
         this.height = Ext.getBody().getViewSize().height - 30;
         // InitialConfig is the config object passed to the constructor on
         // creation of this window. We need to pass it throuh to the form as
         // we need the "modelId" param to load the correct item.
+
+        /*
+        this.items = [{
+            xtype: 'fieldset',
+            title: 'Probenangaben',
+            layout: 'hbox',
+            defaults: {
+                labelWidth: 150
+            },
+            items: [{
+                    layout: 'vbox',
+                    border: 0,
+                    items: [{
+                        xtype: 'mst',
+                        name: 'mstId',
+                        fieldLabel: 'Messstelle',
+                        allowBlank: false
+                    }, {
+                        xtype: 'textfield',
+                        name: 'hauptprobenNr',
+                        maxLength: 20,
+                        fieldLabel: 'Hauptprobennr.'
+                    }]
+            }]
+            */
+/*
+            items: [{
+                layout: 'hbox',
+                border: 0,
+                items: [{
+                    layout: 'vbox',
+                    border: 0,
+                    items: [{
+                        xtype: 'mst',
+                        name: 'mstId',
+                        fieldLabel: 'Messstelle',
+                        allowBlank: false
+                    }, {
+                        xtype: 'textfield',
+                        name: 'hauptprobenNr',
+                        maxLength: 20,
+                        fieldLabel: 'Hauptprobennr.'
+                    }]
+                }, {
+                    xtype: 'fieldset',
+                    title: 'Erweiterte Probenangaben',
+                    collapsible: true,
+                    collapsed: true,
+                    items: [{
+                        xtype: 'datenbasis',
+                        id: 'datenbasis',
+                        editable: false,
+                        name: 'datenbasisId',
+                        fieldLabel: 'Datenbasis'
+                    }, {
+                        xtype: 'betriebsart',
+                        name: 'baId',
+                        fieldLabel: 'Betriebsart'
+                    }, {
+                        xtype: 'testdatensatz',
+                        name: 'test',
+                        fieldLabel: 'Testdatensatz',
+                        allowBlank: false
+                    }, {
+                        xtype: 'probenart',
+                        id: 'probenart',
+                        editable: false,
+                        name: 'probenartId',
+                        fieldLabel: 'Probenart',
+                        allowBlank: false
+                    }, {
+                        xtype: 'numberfield',
+                        allowDecimals: false,
+                        name: 'probeNehmerId',
+                        fieldLabel: 'Probennehmer'
+                    }, {
+                        xtype: 'netzbetreiber',
+                        name: 'netzbetreiberId',
+                        editable: false,
+                        fieldLabel: 'Netzbetreiber',
+                        allowBlank: false
+                    }, {
+                        xtype: 'textfield',
+                        name: 'x11',
+                        fieldLabel: 'Datensatzerzeuger'
+                    }]
+                }]
+            }]
+            */
+//        }];
         var form = Ext.create('Lada.view.proben.EditForm',
             this.initialConfig);
-        this.items = [form];
-        this.callParent();
+        this.items = [{
+            border: 0,
+            autoScroll: true,
+            items: [form]
+        }];
+        this.callParent(arguments);
     }
 });
diff -r 484e12e89d54 -r 369917727c86 app/view/proben/EditForm.js
--- a/app/view/proben/EditForm.js	Thu Dec 11 18:53:29 2014 +0100
+++ b/app/view/proben/EditForm.js	Thu Dec 11 18:54:21 2014 +0100
@@ -30,93 +30,118 @@
     initComponent: function() {
         this.items = [{
             xtype: 'fieldset',
-            title: 'Probenangaben',
+            title: 'Allgemein',
             defaults: {
-                    labelWidth: 150
+                labelWidth: 160
             },
             items: [{
-                xtype: 'mst',
-                name: 'mstId',
-                fieldLabel: 'Messstelle',
-                allowBlank: false
-            }, {
-                xtype: 'textfield',
-                name: 'hauptprobenNr',
-                maxLength: 20,
-                fieldLabel: 'Hauptprobennr.'
-            }, {
-                xtype: 'fieldset',
-                title: 'Erweiterte Probenangaben',
-                collapsible: true,
-                collapsed: true,
+                layout: 'hbox',
+                border: 0,
                 items: [{
-                    xtype: 'datenbasis',
-                    id: 'datenbasis',
-                    editable: false,
-                    name: 'datenbasisId',
-                    fieldLabel: 'Datenbasis'
+                    border: 0,
+                    width: '43%',
+                    minWidth: 290,
+                    items: [{
+                        xtype: 'mst',
+                        name: 'mstId',
+                        fieldLabel: 'Messstelle',
+                        allowBlank: false
+                    }, {
+                        xtype: 'textfield',
+                        name: 'hauptprobenNr',
+                        maxLength: 20,
+                        fieldLabel: 'Hauptprobennr.'
+                    }]
                 }, {
-                    xtype: 'betriebsart',
-                    name: 'baId',
-                    fieldLabel: 'Betriebsart'
-                }, {
-                    xtype: 'testdatensatz',
-                    name: 'test',
-                    fieldLabel: 'Testdatensatz',
-                    allowBlank: false
-                }, {
-                    xtype: 'probenart',
-                    id: 'probenart',
-                    editable: false,
-                    name: 'probenartId',
-                    fieldLabel: 'Probenart',
-                    allowBlank: false
-                }, {
-                    xtype: 'numberfield',
-                    allowDecimals: false,
-                    name: 'probeNehmerId',
-                    fieldLabel: 'Probennehmer'
-                }, {
-                    xtype: 'netzbetreiber',
-                    name: 'netzbetreiberId',
-                    editable: false,
-                    fieldLabel: 'Netzbetreiber',
-                    allowBlank: false
-                }, {
-                    xtype: 'textfield',
-                    name: 'x11',
-                    fieldLabel: 'Datensatzerzeuger'
+                    border: 0,
+                    width: '52%',
+                    minWidth: 300,
+                    items: [{
+                        xtype: 'fieldset',
+                        title: 'Erweiterte Angaben',
+                        collapsible: true,
+                        collapsed: true,
+                        items: [{
+                            xtype: 'datenbasis',
+                            id: 'datenbasis',
+                            editable: false,
+                            name: 'datenbasisId',
+                            fieldLabel: 'Datenbasis'
+                        }, {
+                            xtype: 'betriebsart',
+                            name: 'baId',
+                            fieldLabel: 'Betriebsart'
+                        }, {
+                            xtype: 'testdatensatz',
+                            name: 'test',
+                            fieldLabel: 'Testdatensatz',
+                            allowBlank: false
+                        }, {
+                            xtype: 'probenart',
+                            id: 'probenart',
+                            editable: false,
+                            name: 'probenartId',
+                            fieldLabel: 'Probenart',
+                            allowBlank: false
+                        }, {
+                            xtype: 'numberfield',
+                            allowDecimals: false,
+                            name: 'probeNehmerId',
+                            fieldLabel: 'Probennehmer'
+                        }, {
+                            xtype: 'netzbetreiber',
+                            name: 'netzbetreiberId',
+                            editable: false,
+                            fieldLabel: 'Netzbetreiber',
+                            allowBlank: false
+                        }, {
+                            xtype: 'textfield',
+                            name: 'x11',
+                            fieldLabel: 'Datensatzerzeuger'
+                        }]
+                    }]
                 }]
             }]
         }, {
             // Medium
             xtype: 'fieldset',
             title: 'Medium',
-            defaults: {
-                    labelWidth: 150
-            },
             items: [{
-                xtype: 'uwb',
-                name: 'umwId',
-                fieldLabel: 'Umweltbereich',
-                allowBlank: false
-            }, {
-                xtype: 'textfield',
-                maxLength: 100,
-                name: 'media',
-                fieldLabel: 'Medienbezeichnung'
-            }, {
-                xtype: 'textfield',
-                maxLength: 100,
-                name: 'mediaDesk',
-                fieldLabel: 'Deskriptoren'
-            }, {
-                xtype: 'fieldset',
-                title: 'Details Deskriptoren',
-                collapsible: true,
-                collapsed: true,
-                defaultType: 'textfield',
-                items: this.buildDescriptors()
+                border: 0,
+                layout: {
+                    type: 'vbox',
+                    align: 'stretch'
+                },
+                width: '100%',
+                items: [{
+                    xtype: 'textfield',
+                    name: 'media',
+                    labelWidth: 110,
+                    fieldLabel: 'Medienbezeichnung'
+                }, {
+                    xtype: 'textfield',
+                    maxLength: 100,
+                    name: 'mediaDesk',
+                    labelWidth: 110,
+                    fieldLabel: 'Deskriptoren'
+                }, {
+                    xtype: 'uwb',
+                    name: 'umwId',
+                    fieldLabel: 'Umweltbereich',
+                    labelWidth: 110,
+                    allowBlank: false
+                }, {
+                    xtype: 'fieldset',
+                    title: 'Details Deskriptoren',
+                    collapsible: true,
+                    collapsed: true,
+                    defaultType: 'textfield',
+                    layout: {
+                        type: 'table',
+                        columns: 3
+                    },
+                    items: this.buildDescriptors()
+                }]
             }]
         }, {
             // Zeit
@@ -126,17 +151,29 @@
             defaults: {
                     labelWidth: 150
             },
+            layout: {
+                type: 'table',
+                columns: 2
+            },
             items: [{
                 fieldLabel: 'Probennahme Beginn',
+                margin: '0, 10, 5, 0',
+                labelWidth: 130,
                 name: 'probeentnahmeBeginn'
             }, {
+                fieldLabel: 'Sollzeit Von',
+                margin: '0, 10, 5, 0',
+                labelWidth: 100,
+                name: 'solldatumBeginn'
+            }, {
                 fieldLabel: 'Probennahme Ende',
+                margin: '0, 10, 5, 0',
+                labelWidth: 130,
                 name: 'probeentnahmeEnde'
             }, {
-                fieldLabel: 'Sollzeit Von',
-                name: 'solldatumBeginn'
-            }, {
                 fieldLabel: 'Sollzeit Bis',
+                margin: '0, 10, 5, 0',
+                labelWidth: 100,
                 name: 'solldatumEnde'
             }]
         }, {
@@ -187,7 +224,10 @@
         var fields = [];
         for (var i = 0; i < 12; i++) {
             fields[i] = {
-                fieldLabel: 'S' + i, name: 's' + i
+                fieldLabel: 'S' + i,
+                name: 's' + i,
+                labelWidth: 25,
+                margin: '0, 10, 5, 0'
             };
         }
         return fields;
diff -r 484e12e89d54 -r 369917727c86 app/view/widgets/LadaForm.js
--- a/app/view/widgets/LadaForm.js	Thu Dec 11 18:53:29 2014 +0100
+++ b/app/view/widgets/LadaForm.js	Thu Dec 11 18:54:21 2014 +0100
@@ -18,6 +18,7 @@
     alias: 'widget.ladaform',
     bodyPadding: '10 10',
     border: 0,
+    minWidth: 650,
 
     /**
      * Can be a reference to a model instance or a model class name.


More information about the Lada-commits mailing list