comparison app/controller/Map.js @ 742:6e28ebbe1a73

added documentation for Form and Grid controllers
author Dustin Demuth <dustin@intevation.de>
date Thu, 23 Apr 2015 16:28:04 +0200
parents d21048cbdbb3
children
comparison
equal deleted inserted replaced
740:2e8da590ea0c 742:6e28ebbe1a73
5 * and comes with ABSOLUTELY NO WARRANTY! Check out 5 * and comes with ABSOLUTELY NO WARRANTY! Check out
6 * the documentation coming with IMIS-Labordaten-Application for details. 6 * the documentation coming with IMIS-Labordaten-Application for details.
7 */ 7 */
8 8
9 /** 9 /**
10 * This is a controller for a Map.
11 * Maps are used in the Ortsangaben of a Probe.
10 */ 12 */
11 Ext.define('Lada.controller.Map', { 13 Ext.define('Lada.controller.Map', {
12 extend: 'Ext.app.Controller', 14 extend: 'Ext.app.Controller',
13 15
14 requires: [ 16 requires: [
15 ], 17 ],
16 18
19 /**
20 * Initialize the Controller
21 * It has only one listener.
22 */
17 init: function() { 23 init: function() {
18 this.control({ 24 this.control({
19 'maptoolbar button[action=add]': { 25 'maptoolbar button[action=add]': {
20 click: this.addLocation 26 click: this.addLocation
21 } 27 }
22 }); 28 });
23 this.callParent(arguments); 29 this.callParent(arguments);
24 }, 30 },
25 31
32 /**
33 * addLocation is a function which can be
34 * used to add an location to create a new Location
35 * with the help of the map.
36 * The function uses {@link Lada.view.panel.Map#activateDraw}
37 */
26 addLocation: function(button) { 38 addLocation: function(button) {
27 var mapPanel = button.up('map'); 39 var mapPanel = button.up('map');
28 var details = button.up('window').down('locationform'); 40 var details = button.up('window').down('locationform');
29 var newLocation = Ext.create('Lada.model.Location'); 41 var newLocation = Ext.create('Lada.model.Location');
30 details.setRecord(newLocation); 42 details.setRecord(newLocation);

http://lada.wald.intevation.org