view app/controller/Map.js @ 990:c2a726887dd7

The last status can not be edited anymore. When a new status is added, the new record is preset with ALL previous variables, this includes the StatusStufe! The Date is corrected to the current date. Also the store is sorted by Datum now.
author Dustin Demuth <dustin@intevation.de>
date Wed, 16 Dec 2015 09:49:09 +0100
parents 6e28ebbe1a73
children
line wrap: on
line source
/* 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.
 */

/**
 * This is a controller for a Map.
 * Maps are used in the Ortsangaben of a Probe.
 */
Ext.define('Lada.controller.Map', {
    extend: 'Ext.app.Controller',

    requires: [
    ],

    /**
     * Initialize the Controller
     * It has only one listener.
     */
    init: function() {
        this.control({
            'maptoolbar button[action=add]': {
                click: this.addLocation
            }
        });
        this.callParent(arguments);
    },

    /**
     * addLocation is a function which can be
     * used to add an location to create a new Location
     * with the help of the map.
     * The function uses {@link Lada.view.panel.Map#activateDraw}
     */
    addLocation: function(button) {
        var mapPanel = button.up('map');
        var details = button.up('window').down('locationform');
        var newLocation = Ext.create('Lada.model.Location');
        details.setRecord(newLocation);
        details.setReadOnly(false);

        mapPanel.activateDraw(newLocation);
    }
});

http://lada.wald.intevation.org