changeset 1021:1df6b6210b42 stammdatengrids

WIP First Version of a New Window/Panel combination to edit Ortszuordnungen and Orte
author Dustin Demuth <dustin@intevation.de>
date Thu, 04 Feb 2016 16:31:46 +0100
parents e9e974d31924
children 6d33a84979e4
files app.js app/controller/Filter.js app/controller/form/Ortszuordnung.js app/model/DatensatzErzeuger.js app/model/MessprogrammKategorie.js app/model/Ort.js app/model/Probenehmer.js app/view/form/Ortszuordnung.js app/view/grid/MessprogrammeList.js app/view/grid/Orte.js app/view/grid/Ortszuordnung.js app/view/grid/ProbeList.js app/view/panel/Map.js app/view/panel/Ort.js app/view/widget/DynamicGrid.js app/view/window/OrtCreate.js app/view/window/OrtEdit.js app/view/window/Ortszuordnung.js index.html
diffstat 19 files changed, 373 insertions(+), 470 deletions(-) [+]
line wrap: on
line diff
--- a/app.js	Fri Jan 29 14:51:17 2016 +0100
+++ b/app.js	Thu Feb 04 16:31:46 2016 +0100
@@ -136,7 +136,8 @@
             storeId: 'netzbetreiber'
         });
         Ext.create('Lada.store.Orte', {
-            storeId: 'orte'
+            storeId: 'orte',
+            defaultPageSize: 0
         });
         Ext.create('Lada.store.Pflichtmessgroessen', {
             storeId: 'pflichtmessgroessen'
--- a/app/controller/Filter.js	Fri Jan 29 14:51:17 2016 +0100
+++ b/app/controller/Filter.js	Thu Feb 04 16:31:46 2016 +0100
@@ -128,7 +128,7 @@
                     resultGrid = Ext.create('Lada.view.grid.DatensatzErzeuger');
                     break;
                 case 'ort':
-                    resultGrid = Ext.create('Lada.view.grid.Orte');
+                    resultGrid = Ext.create('Lada.view.panel.Ort');
                     break;
                 case 'probenehmer':
                     resultGrid = Ext.create('Lada.view.grid.Probenehmer');
--- a/app/controller/form/Ortszuordnung.js	Fri Jan 29 14:51:17 2016 +0100
+++ b/app/controller/form/Ortszuordnung.js	Thu Feb 04 16:31:46 2016 +0100
@@ -17,6 +17,9 @@
      */
     init: function() {
         this.control({
+            'ortszuordnungform button[action=setOrt]': {
+                toggle: this.pickOrt
+            },
             'ortszuordnungform button[action=save]': {
                 click: this.save
             },
@@ -25,9 +28,6 @@
             },
             'ortszuordnungform': {
                 dirtychange: this.dirtyForm
-            },
-            'ortszuordnungform combobox[name=ort]': {
-                select: this.updateDetails
             }
         });
     },
@@ -38,6 +38,17 @@
       * on failure, it will display an Errormessage
       */
      save: function(button) {
+
+        //try to disable ortPickerButton:
+        try {
+           var ob = this.up('form').down('ortszuordnungform button[action=setOrt]');
+           if (ob.pressed) {
+                ob.toggle(false);
+            }
+        }
+        catch (e) {
+        }
+
         var formPanel = button.up('ortszuordnungform');
         var data = formPanel.getForm().getFieldValues(true);
         var i18n = Lada.getApplication().bundle;
@@ -58,7 +69,6 @@
                     formPanel.setRecord(record);
                     formPanel.setMessages(json.errors, json.warnings);
                     formPanel.up('window').grid.store.reload();
-                    debugger;
                 }
             },
             failure: function(record, response) {
@@ -98,6 +108,28 @@
     },
 
     /**
+     * When the button is Active, a Record can be selected.
+     * If the Record was selected from a grid this function
+     *  sets the ortzuordnung.
+     * TODO: Check if the selected Record is a ORT
+     * TODO: Enable picking from Maps
+     */
+     pickOrt: function(button, pressed, opts) {
+        var i18n = Lada.getApplication().bundle;
+        var oForm = button.up('form');
+        var osg = button.up('window').down('ortstammdatengrid');
+        if (button.pressed) {
+            button.setText(i18n.getMsg('ortszuordnung.form.setOrt.pressed'));
+            osg.addListener('select',oForm.setOrt, oForm);
+        }
+        else {
+            button.setText(i18n.getMsg('ortszuordnung.form.setOrt'));
+            osg.removeListener('select',oForm.setOrt, oForm);
+        }
+     },
+
+
+    /**
      * The dirtyForm function enables or disables the save and discard
      * button which are present in the toolbar of the form.
      * The Buttons are only active if the content of the form was altered
--- a/app/model/DatensatzErzeuger.js	Fri Jan 29 14:51:17 2016 +0100
+++ b/app/model/DatensatzErzeuger.js	Thu Feb 04 16:31:46 2016 +0100
@@ -58,6 +58,7 @@
         url: 'lada-server/rest/datensatzerzeuger',
         reader: {
             type: 'json',
+            totalProperty: 'totalCount',
             root: 'data'
         }
     }
--- a/app/model/MessprogrammKategorie.js	Fri Jan 29 14:51:17 2016 +0100
+++ b/app/model/MessprogrammKategorie.js	Thu Feb 04 16:31:46 2016 +0100
@@ -56,6 +56,7 @@
         url: 'lada-server/rest/messprogrammkategorie',
         reader: {
             type: 'json',
+            totalProperty: 'totalCount',
             root: 'data'
         }
     }
--- a/app/model/Ort.js	Fri Jan 29 14:51:17 2016 +0100
+++ b/app/model/Ort.js	Thu Feb 04 16:31:46 2016 +0100
@@ -82,6 +82,7 @@
         url: 'lada-server/rest/ort',
         reader: {
             type: 'json',
+            totalProperty: 'totalCount',
             root: 'data'
         }
     }
--- a/app/model/Probenehmer.js	Fri Jan 29 14:51:17 2016 +0100
+++ b/app/model/Probenehmer.js	Thu Feb 04 16:31:46 2016 +0100
@@ -74,6 +74,7 @@
         url: 'lada-server/rest/probenehmer',
         reader: {
             type: 'json',
+            totalProperty: 'totalCount',
             root: 'data'
         }
     }
--- a/app/view/form/Ortszuordnung.js	Fri Jan 29 14:51:17 2016 +0100
+++ b/app/view/form/Ortszuordnung.js	Thu Feb 04 16:31:46 2016 +0100
@@ -14,20 +14,28 @@
     alias: 'widget.ortszuordnungform',
 
     model: 'Lada.model.Ortszuordnung',
-    width: '100%',
+
+    requires: [
+        'Lada.view.widget.Verwaltungseinheit',
+        'Lada.view.widget.Staat'
+    ],
+
+    layout: 'fit',
     margin: 5,
     border: 0,
 
     record: null,
 
-    trackResetOnLoad: true,
+    //trackResetOnLoad: true,
 
     initComponent: function() {
         var i18n = Lada.getApplication().bundle;
         this.items = [{
             xtype: 'fieldset',
             title: i18n.getMsg('ortszuordnung.form.fset.title'),
+            layout: 'fit',
             items: [{
+                layout: 'hbox',
                 border: 0,
                 margin: '0, 0, 10, 0',
                 dockedItems: [{
@@ -39,7 +47,14 @@
                         borderLeft: '1px solid #b5b8c8 !important',
                         borderRight: '1px solid #b5b8c8 !important'
                     },
-                    items: ['->', {
+                    items: [{
+                        text: i18n.getMsg('ortszuordnung.form.setOrt'),
+                        qtip: i18n.getMsg('ortszuordnung.form.setOrt.qtip'),
+                        icon: 'resources/img/dialog-ok-apply.png',
+                        action: 'setOrt',
+                        enableToggle: true,
+                        disabled: true
+                    }, '->', {
                         text: i18n.getMsg('save'),
                         qtip: i18n.getMsg('save.qtip'),
                         icon: 'resources/img/dialog-ok-apply.png',
@@ -54,25 +69,39 @@
                     }]
                 }],
                 items: [{
-                    xtype: 'container',
-                    layout: {
-                        type: 'hbox'
-                    },
-                    flex: 1,
+                    layout: 'vbox',
+                    border: 0,
                     items: [{
                         xtype: 'tfield',
                         maxLength: 100,
                         name: 'ortszusatztext',
                         fieldLabel: i18n.getMsg('ortszuordnung.form.field.ortszusatztext'),
-                        width: 280,
-                        labelWidth: 80
                     }, {
                         xtype: 'tfield',
                         maxLength: 100,
                         name: 'ortszuordnungTyp',
                         fieldLabel: i18n.getMsg('ortszuordnung.form.field.ortszuordnungtyp'),
-                        width: 280,
-                        labelWidth: 80
+                    }, {
+                        xtype: 'textfield',
+                        readOnly: true,
+                        hidden: true,
+                        name: 'ortId'
+                    }]
+                }, {
+                    layout: 'vbox',
+                    border: 0,
+                    items: [{
+                        xtype: 'displayfield',
+                        fieldLabel: i18n.getMsg('orte.gemId'),
+                        name: 'gemId'
+                    }, {
+                        xtype: 'displayfield',
+                        fieldLabel: i18n.getMsg('Gemeinde'),
+                        name: 'gemeinde'
+                    }, {
+                        xtype: 'displayfield',
+                        fieldLabel: i18n.getMsg('staat'),
+                        name: 'staat'
                     }]
                 }]
             }]
@@ -82,6 +111,52 @@
 
     setRecord: function(record) {
         this.getForm().loadRecord(record);
+
+        if (! record.get('readonly')) {
+            this.down('[action=setOrt]').enable();
+            this.setReadOnly(false);
+        }
+        else {
+            this.setReadOnly(true);
+        }
+        this.refreshOrt();
+    },
+
+    refreshOrt: function() {
+        var ortId = this.getRecord().get('ortId');
+
+        var orteStore = Ext.StoreManager.get('orte');
+        var ort = orteStore.getById(ortId);
+        var verwStore =  Ext.StoreManager.get('verwaltungseinheiten');
+        var verw = verwStore.getById(ort.get('gemId'));
+        var staatStore =  Ext.StoreManager.get('staaten');
+        var staat = staatStore.getById(ort.get('staatId'));
+
+        this.getForm().setValues({
+            gemId: ort.get('gemId'),
+            gemeinde: verw.get('bezeichnung'),
+            staat: staat.get('staatIso')
+        });
+    },
+
+    /**
+     * setOrt can be called from a CallbackFunction, ie select from a grid.
+     *  it will set the ortId of this record
+     */
+    setOrt: function(row, selRecord, index, opts) {
+
+    console.log('setOrt' + Date.now());
+        var newOrtId = selRecord.get('id');
+        var r = this.getRecord();
+        if (newOrtId) {
+            if (newOrtId != r.get('ortId')) {
+                this.getForm().setValues({ ortId: newOrtId});
+                this.refreshOrt();
+                //set dirty...
+                //this.fireEvent('dirtychange', this.getForm(), true);
+            }
+        }
+    console.log('setOrtEnd' + Date.now());
     },
 
     setMessages: function(errors, warnings) {
--- a/app/view/grid/MessprogrammeList.js	Fri Jan 29 14:51:17 2016 +0100
+++ b/app/view/grid/MessprogrammeList.js	Thu Feb 04 16:31:46 2016 +0100
@@ -24,7 +24,6 @@
             dock: 'top',
             items: [{
                 xtype: 'tbtext',
-                id: 'tbtitle',
                 text: i18n.getMsg('messprogramme.gridTitle')
             },
             '->',
--- a/app/view/grid/Orte.js	Fri Jan 29 14:51:17 2016 +0100
+++ b/app/view/grid/Orte.js	Thu Feb 04 16:31:46 2016 +0100
@@ -31,27 +31,6 @@
         var i18n = Lada.getApplication().bundle;
         this.emptyText = i18n.getMsg('orte.emptyGrid');
 
-        this.dockedItems = [{
-            xtype: 'toolbar',
-            dock: 'top',
-            items: [{
-                xtype: 'tbtext',
-                id: 'tbtitle',
-                text: i18n.getMsg('orte.gridTitle')
-            },
-            '->',
-            {
-                text: i18n.getMsg('orte.button.add'),
-                icon: 'resources/img/list-add.png',
-                action: 'add',
-                disabled: true // disabled on startup, will be enabled by setStore
-            }, {
-                text: i18n.getMsg('orte.button.delete'),
-                icon: 'resources/img/list-remove.png',
-                action: 'delete',
-                disabled: true // disabled on startup, will be enabled by controller if necessary
-            }]
-        }];
         this.columns = [{
             header: i18n.getMsg('orte.ortId'),
             dataIndex: 'ortId'
@@ -144,16 +123,21 @@
         var i18n = Lada.getApplication().bundle;
 
         if (store) {
-            this.removeDocked(Ext.getCmp('ptbar'), true);
             this.reconfigure(store);
-            this.down('button[action=add]').enable();
-            this.addDocked([{
-                xtype: 'pagingtoolbar',
-                id: 'ptbar',
-                dock: 'bottom',
-                store: store,
-                displayInfo: true
-            }]);
+
+            var ptbar = this.down('pagingtoolbar');
+            if (ptbar) {
+                this.removeDocked(ptbar);
+            }
+
+            if (store.pageSize > 0) {
+                this.addDocked([{
+                    xtype: 'pagingtoolbar',
+                    dock: 'bottom',
+                    store: store,
+                    displayInfo: true
+                }]);
+            }
         }
     }
 });
--- a/app/view/grid/Ortszuordnung.js	Fri Jan 29 14:51:17 2016 +0100
+++ b/app/view/grid/Ortszuordnung.js	Thu Feb 04 16:31:46 2016 +0100
@@ -48,14 +48,14 @@
         this.columns = [{
             header: 'Typ',
             dataIndex: 'ortszuordnungTyp',
-            width: 50,
+            flex: 1,
             editor: {
                 allowBlank: false
             }
         }, {
             header: 'Staat',
             dataIndex: 'ortId',
-            width: 70,
+            flex: 1,
             renderer: function(value) {
                 var store = Ext.data.StoreManager.get('orte');
                 var staaten = Ext.data.StoreManager.get('staaten');
@@ -66,7 +66,7 @@
         }, {
             header: 'Gemeindeschlüssel',
             dataIndex: 'ortId',
-            width: 120,
+            flex: 3,
             renderer: function(value) {
                 var store = Ext.data.StoreManager.get('orte');
                 var record = store.getById(value);
@@ -75,7 +75,7 @@
         }, {
             header: 'Gemeindename',
             dataIndex: 'ortId',
-            flex: 1,
+            flex: 4,
             renderer: function(value) {
                 var store = Ext.data.StoreManager.get('orte');
                 var gemeinden =
@@ -87,6 +87,7 @@
             }
         }, {
             header: 'Ortszusatztext',
+            flex: 6,
             dataIndex: 'ortszusatztext'
         }];
         this.listeners = {
--- a/app/view/grid/ProbeList.js	Fri Jan 29 14:51:17 2016 +0100
+++ b/app/view/grid/ProbeList.js	Thu Feb 04 16:31:46 2016 +0100
@@ -24,7 +24,6 @@
             dock: 'top',
             items: [{
                 xtype: 'tbtext',
-                id: 'tbtitle',
                 text: i18n.getMsg('probe.gridTitle')
             },
             '->',
--- a/app/view/panel/Map.js	Fri Jan 29 14:51:17 2016 +0100
+++ b/app/view/panel/Map.js	Thu Feb 04 16:31:46 2016 +0100
@@ -14,9 +14,15 @@
 Ext.define('Lada.view.panel.Map', {
     extend: 'Ext.panel.Panel',
     alias: 'widget.map',
+    name: 'map',
 
     record: null,
     locationRecord: null,
+    externalOrteStore: false,
+    /*
+     * if externalOrteStore is true, the mappanel will not load the orte
+     * store on it's own; it expects an already loaded store instead
+     */
 
     /**
      * @cfg
@@ -62,7 +68,6 @@
         keyControl.activate();
         this.bodyStyle = {background: '#fff'};
         this.initData();
-        this.tbar = Ext.create('Lada.view.widget.MapToolbar');
         this.addEvents('featureselected');
         this.callParent(arguments);
     },
@@ -73,54 +78,11 @@
      */
     initData: function() {
         var me = this;
-        this.locationFeatures = [];
-        this.locationStore = Ext.data.StoreManager.get('locations');
-        for (var i = 0; i < this.locationStore.count(); i++) {
-            this.locationFeatures.push(new OpenLayers.Feature.Vector(
-                new OpenLayers.Geometry.Point(
-                    this.locationStore.getAt(i).get('longitude'),
-                    this.locationStore.getAt(i).get('latitude')
-                ),
-                {
-                    id: this.locationStore.getAt(i).get('id'),
-                    bez: this.locationStore.getAt(i).get('bezeichnung')
-                }
-            ));
+
+        if (!this.externalOrteStore) {
+            this.locationStore = Ext.data.StoreManager.get('orte');
+            this.addLocations(locationStore);
         }
-        this.featureLayer = new OpenLayers.Layer.Vector('vector_' + this.map.name, {
-            styleMap: new OpenLayers.StyleMap({
-                'default': new OpenLayers.Style(OpenLayers.Util.applyDefaults({
-                    externalGraphic: 'resources/lib/OpenLayers/img/marker-green.png',
-                    graphicOpacity: 1,
-                    pointRadius: 10,
-                    label: '${bez}',
-                    labelAlign: 'rt',
-                    fontColor: 'green',
-                    fontWeight: 'bold'
-                }, OpenLayers.Feature.Vector.style['default'])),
-                'select': new OpenLayers.Style({
-                    externalGraphic: 'resources/lib/OpenLayers/img/marker-blue.png',
-                    pointRadius: 15,
-                    label: '${bez}',
-                    labelAlign: 'rt',
-                    fontColor: 'blue',
-                    fontWeight: 'bold'
-                })
-            })
-        });
-        this.featureLayer.addFeatures(this.locationFeatures);
-        this.map.addLayer(this.featureLayer);
-
-        this.selectControl = new OpenLayers.Control.SelectFeature(this.featureLayer, {
-            clickout: false,
-            toggle: false,
-            multiple: false,
-            hover: false,
-            onSelect: me.selectedFeature,
-            scope: me
-        });
-        this.map.addControl(this.selectControl);
-        this.selectControl.activate();
     },
 
     selectFeature: function(id) {
@@ -151,6 +113,61 @@
         this.selectControl.select(features.feature);
     },
 
+    addLocations: function(locationStore) {
+        locationFeatures = [];
+
+        // Iterate the Store and create features from it
+        for (var i = 0; i < locationStore.count(); i++) {
+            locationFeatures.push(new OpenLayers.Feature.Vector(
+                new OpenLayers.Geometry.Point(
+                    locationStore.getAt(i).get('longitude'),
+                    locationStore.getAt(i).get('latitude')
+                ),
+                {
+                    id: locationStore.getAt(i).get('id'),
+                    bez:locationStore.getAt(i).get('kurztext')
+                }
+            ));
+        }
+
+        // Create a new Feature Layer and add it to the map
+        this.featureLayer = new OpenLayers.Layer.Vector('vector_' + this.map.name, {
+            styleMap: new OpenLayers.StyleMap({
+                'default': new OpenLayers.Style(OpenLayers.Util.applyDefaults({
+                    externalGraphic: 'resources/lib/OpenLayers/img/marker-green.png',
+                    graphicOpacity: 1,
+                    pointRadius: 10,
+                    label: '${bez}',
+                    labelAlign: 'rt',
+                    fontColor: 'green',
+                    fontWeight: 'bold'
+                }, OpenLayers.Feature.Vector.style['default'])),
+                'select': new OpenLayers.Style({
+                    externalGraphic: 'resources/lib/OpenLayers/img/marker-blue.png',
+                    pointRadius: 15,
+                    label: '${bez}',
+                    labelAlign: 'rt',
+                    fontColor: 'blue',
+                    fontWeight: 'bold'
+                })
+            })
+        });
+        this.featureLayer.addFeatures(locationFeatures);
+        this.map.addLayer(this.featureLayer);
+
+        this.selectControl = new OpenLayers.Control.SelectFeature(this.featureLayer, {
+            clickout: false,
+            toggle: false,
+            multiple: false,
+            hover: false,
+            onSelect: me.selectedFeature,
+            scope: me
+        });
+        this.map.addControl(this.selectControl);
+        this.selectControl.activate();
+    },
+
+
     /**
      * @private
      * Override to display and update the map view in the panel.
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/app/view/panel/Ort.js	Thu Feb 04 16:31:46 2016 +0100
@@ -0,0 +1,128 @@
+Ext.define('Lada.view.panel.Ort', {
+    extend: 'Ext.panel.Panel',
+    alias: 'widget.ortpanel',
+
+    requires: [
+        'Lada.view.panel.Map',
+        'Lada.view.grid.Orte'
+    ],
+
+    width: '100%',
+    //height: 200,
+
+    layout: {
+        type: 'border',
+    },
+    toolbarPos: 'top',
+
+    initComponent: function() {
+        var i18n = Lada.getApplication().bundle;
+
+        // Different Layout of toolbar depending on the bars position.
+        if (this.toolbarPos == 'top') {
+            this.dockedItems = [{
+                xtype: 'toolbar',
+                dock: 'top',
+                items: [{
+                    xtype: 'tbtext',
+                    text: i18n.getMsg('orte.gridTitle')
+                },
+                '->',
+                {
+                    text: i18n.getMsg('map.button.add'),
+                    icon: 'resources/img/list-add.png',
+                    action: 'addMap',
+                    disabled: true // disabled on startup, will be enabled by setStore
+                }, {
+                    text: i18n.getMsg('orte.button.add'),
+                    icon: 'resources/img/list-add.png',
+                    action: 'add',
+                    disabled: true // disabled on startup, will be enabled by setStore
+                }, {
+                    text: i18n.getMsg('orte.button.delete'),
+                    icon: 'resources/img/list-remove.png',
+                    action: 'delete',
+                    disabled: true // disabled on startup, will be enabled by controller if necessary
+                }]
+            }];
+        }
+        else {
+            this.dockedItems = [{
+                xtype: 'toolbar',
+                dock: this.toolbarPos,
+                items: [ '->',
+                {
+                    text: i18n.getMsg('map.button.add'),
+                    icon: 'resources/img/list-add.png',
+                    action: 'addMap',
+                    disabled: true // disabled on startup, will be enabled by setStore
+                }, {
+                    text: i18n.getMsg('orte.button.add'),
+                    icon: 'resources/img/list-add.png',
+                    action: 'add',
+                    disabled: true // disabled on startup, will be enabled by setStore
+                }]
+            }];
+        }
+
+        this.items = [{
+            xtype: 'ortstammdatengrid',
+            width: '60%',
+            collapsible: true,
+            region: 'east',
+        }, {
+            xtype: 'map',
+            region: 'center',
+            layout: 'border',
+            title: i18n.getMsg('map.title'),
+            externalOrteStore: true,
+            listeners: {
+                beforecollapse: function() {
+                    var c = this.map.getControlsByClass('OpenLayers.Control.ScaleLine');
+                    this.map.removeControl(c[0]);
+                },
+                expand: function() {
+                    this.map.addControl(new OpenLayers.Control.ScaleLine());
+                }
+            }
+        }],
+
+        this.callParent(arguments);
+    },
+
+    setStore: function(store) {
+        var me = this;
+        var osg = this.down('ortstammdatengrid');
+        var map = this.down('map');
+
+        if (!store) {
+            var ortstore = Ext.create('Lada.store.Orte', {
+                defaultPageSize: 0,
+                listeners: {
+                    beforeload: {
+                        fn: function() {
+                            osg.setLoading(true);
+                            map.setLoading(true);
+                        }
+                    },
+                    load: {
+                        fn: function() {
+                            osg.setLoading(false);
+                            map.setLoading(false);
+                            osg.setStore(ortstore);
+                            map.addLocations(ortstore);
+
+                        }
+                    }
+                }
+            });
+        }
+        else {
+            osg.setStore(store);
+            map.addLocations(store);
+        }
+        //enable buttons
+        me.down('toolbar button[action=add]').enable();
+        me.down('toolbar button[action=addMap]').enable();
+    }
+});
--- a/app/view/widget/DynamicGrid.js	Fri Jan 29 14:51:17 2016 +0100
+++ b/app/view/widget/DynamicGrid.js	Thu Feb 04 16:31:46 2016 +0100
@@ -35,11 +35,14 @@
     setStore: function(store){
         var i18n = Lada.getApplication().bundle;
 
-        this.removeDocked(Ext.getCmp('ptbar'), true);
         this.reconfigure(store);
+        var ptbar = this.down('pagingtoolbar');
+        if (ptbar) {
+            this.removeDocked(ptbar);
+        }
+
         this.addDocked([{
             xtype: 'pagingtoolbar',
-            id: 'ptbar',
             dock: 'bottom',
             store: store,
             displayInfo: true
--- a/app/view/window/OrtCreate.js	Fri Jan 29 14:51:17 2016 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,146 +0,0 @@
-/* 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 a Ort
- */
-Ext.define('Lada.view.window.OrtCreate', {
-    extend: 'Ext.window.Window',
-    alias: 'widget.ortcreate',
-
-    requires: [
-        'Lada.view.panel.Map',
-        'Lada.view.form.Ort',
-        'Lada.view.form.Location'
-    ],
-
-    collapsible: true,
-    maximizable: true,
-    autoshow: true,
-    layout: 'border',
-    constrain: true,
-
-    record: null,
-    grid: null,
-
-    /**
-     * This function initialises the Window
-     */
-    initComponent: function() {
-        this.title = 'Ort';
-        this.buttons = [{
-            text: 'Schließen',
-            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: 'vbox',
-            items: [{
-                xtype: 'ortform',
-                margin: 5
-            }, {
-                xtype: 'locationform',
-                margin: 5
-            }]
-        }, {
-            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',
-                listeners: { //A listener which listens to the mappanels featureselected event
-                    featureselected: this.selectedFeature
-                }
-            }]
-        }];
-        this.callParent(arguments);
-    },
-
-    /**
-     * Initialise the Data of this Window
-     */
-    initData: function() {
-        var ort = Ext.create('Lada.model.Ort', {
-            probeId: this.record.get('id')
-        });
-        this.down('ortform').setRecord(ort);
-    },
-
-    /**
-     * @private
-     * Override to display and update the map view in the panel.
-     */
-    afterRender: function(){
-        this.superclass.afterRender.apply(this, arguments);
-        var map = this.down('map');
-        map.map.zoomToMaxExtent();
-    },
-
-    /**
-     * This function is used by the MapPanel, when a Feature was selected
-     */
-    selectedFeature: function(context, args) {
-    var feature = args[0];
-        if (feature.attributes.id &&
-            feature.attributes.id !== '') {
-            var record = Ext.data.StoreManager.get('locations').getById(feature.attributes.id);
-            context.up('window').down('locationform').setRecord(record);
-            context.up('window').down('locationform').setReadOnly(true);
-            context.up('window').down('ortform').down('combobox').setValue(record.id);
-        }
-        else {
-            context.up('window').down('locationform').setRecord(this.locationRecord);
-            context.up('window').down('locationform').setReadOnly(false);
-        }
-    },
-
-    /**
-     * 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
-    }
-});
--- a/app/view/window/OrtEdit.js	Fri Jan 29 14:51:17 2016 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,204 +0,0 @@
-/* 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 Ort
- */
-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',
-    constrain: true,
-
-    parentWindow: null,
-    probe: null,
-    record: null,
-    grid: null,
-
-    /**
-     * This function initialises the Window
-     */
-    initComponent: function() {
-        if (this.record === null) {
-            Ext.Msg.alert('Kein valider Ort ausgewählt!');
-            this.callParent(arguments);
-            return;
-        }
-        if (this.probe === null) {
-            Ext.Msg.alert('Zu dem Ort existiert keine Probe!');
-            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'};
-
-        // 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: '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',
-                record: this.record,
-                bodyStyle: {
-                    background: '#fff'
-                },
-                name: 'map',
-                listeners: { //A listener which listens to the mappanels featureselected event
-                    featureselected: this.selectedFeature
-                }
-            }]
-        }];
-        this.callParent(arguments);
-    },
-
-    /**
-     * Initialise the Data of this Window
-     */
-    initData: function() {
-        Ext.ClassManager.get('Lada.model.Ort').load(this.record.get('id'), {
-            failure: function(record, action) {
-                // TODO
-            },
-            success: function(record, response) {
-                var me = this;
-                if (record.get('treeModified') < record.get('parentModified')) {
-                    Ext.Msg.show({
-                        title: 'Probe nicht aktuell!',
-                        msg: 'Die zugehörige Probe wurde verändert.\nMöchten Sie zu der Probe zurückkehren und neu laden?\nOhne das erneute Laden der Probe wird das Speichern des Ortes nicht möglich sein.',
-                        buttons: Ext.Msg.OKCANCEL,
-                        icon: Ext.Msg.WARNING,
-                        closable: false,
-                        fn: function(button) {
-                            if (button === 'ok') {
-                                me.close();
-                                me.parentWindow.initData();
-                            }
-                            else {
-                                me.record.set('treeModified', me.probe.get('treeModified'));
-                            }
-                        }
-                    });
-                }
-                this.down('ortform').setRecord(record);
-                if (this.probe.get('readonly')) {
-                    this.down('ortform').setReadOnly(true);
-                }
-                this.record = record;
-            },
-            scope: this
-        });
-        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
-        });
-    },
-
-    /**
-     * @private
-     * Override to display and update the map view in the panel.
-     */
-    afterRender: function(){
-        this.superclass.afterRender.apply(this, arguments);
-        var map = this.down('map');
-        if (this.record) {
-            map.selectFeature(this.record.get('ort'));
-        }
-        else {
-            map.map.zoomToMaxExtent();
-        }
-    },
-
-    /**
-     * This function is used by the MapPanel, when a Feature was selected
-     */
-    selectedFeature: function(context, args) {
-    var feature = args[0];
-        if (feature.attributes.id &&
-            feature.attributes.id !== '') {
-            var record = Ext.data.StoreManager.get('locations').getById(feature.attributes.id);
-            context.up('window').down('locationform').setRecord(record);
-            context.up('window').down('locationform').setReadOnly(true);
-            context.up('window').down('ortform').down('combobox').setValue(record.id);
-        }
-        else {
-            context.up('window').down('locationform').setRecord(this.locationRecord);
-            context.up('window').down('locationform').setReadOnly(false);
-        }
-    },
-
-    /**
-     * 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
-    }
-});
--- a/app/view/window/Ortszuordnung.js	Fri Jan 29 14:51:17 2016 +0100
+++ b/app/view/window/Ortszuordnung.js	Thu Feb 04 16:31:46 2016 +0100
@@ -14,13 +14,14 @@
     alias: 'widget.ortszuordnungwindow',
 
     requires: [
-        'Lada.view.form.Ortszuordnung'
+        'Lada.view.form.Ortszuordnung',
+        'Lada.view.panel.Ort'
     ],
 
     collapsible: true,
     maximizable: true,
     autoshow: true,
-    layout: 'border',
+    layout: 'vbox',
     constrain: true,
 
     probe: null,
@@ -37,14 +38,14 @@
         this.title = i18n.getMsg('ortszuordnung.window.title');
 
         if (this.record && this.probe) {
-            // A new record will be created
+            // A record be edited
             this.title = i18n.getMsg('ortszuordnung.window.title')
                             + ' '
                             + i18n.getMsg('ortszuordnung.window.title2')
                             + ' '
                             + i18n.getMsg('probe')
                             + ' '
-                            + probe.get('hauptprobennr')
+                            + this.probe.get('hauptprobennr')
                             + ' '
                             + i18n.getMsg('edit');
         }
@@ -56,7 +57,7 @@
                             + ' '
                             + i18n.getMsg('probe')
                             + ' '
-                            + probe.get('hauptprobennr')
+                            + this.probe.get('hauptprobennr')
                             + ' '
                             + i18n.getMsg('create');
         }
@@ -81,16 +82,14 @@
         });
 
         this.items = [{
-            region: 'west',
-            border: 0,
-            layout: 'hbox',
-            items: [{
-                xtype: 'ortszuordnungform',
-                margin: 5
-            //}, {
-            //    xtype: 'ortpanel',
-            //    margin: 5
-            }]
+            xtype: 'ortszuordnungform',
+            layout: 'fit',
+            margin: 5
+        }, {
+            xtype: 'ortpanel',
+            flex: 1,
+            toolbarPos: 'bottom',
+            margin: 5
         }];
         this.callParent(arguments);
     },
@@ -100,6 +99,17 @@
      */
     initData: function() {
         this.down('ortszuordnungform').setRecord(this.record);
+        this.down('ortpanel').setStore();
+    },
+
+    /**
+     * @private
+     * Override to display and update the map view in the panel.
+     */
+    afterRender: function(){
+        this.superclass.afterRender.apply(this, arguments);
+        var map = this.down('ortpanel').down('map');
+        map.map.zoomToMaxExtent();
     },
 
     /**
--- a/index.html	Fri Jan 29 14:51:17 2016 +0100
+++ b/index.html	Thu Feb 04 16:31:46 2016 +0100
@@ -20,7 +20,7 @@
     <script type="text/javascript" src="resources/lib/Blob/Blob.js"></script>
     <!-- <x-compile> -->
     <!-- <x-bootstrap> -->
-    <script type="text/javascript" src="extjs/ext-all.js"></script>
+    <script type="text/javascript" src="extjs/ext-all-dev.js"></script>
     <script type="text/javascript" src="extjs/locale/ext-lang-de.js"></script>
     <!-- </x-bootstrap> -->
     <script type="text/javascript" src="app.js"></script>

http://lada.wald.intevation.org