comparison app/controller/grid/Ortszuordnung.js @ 1279:291df0037835

Ortszuordnung window: create, change and display (wip)
author Maximilian Krambach <mkrambach@intevation.de>
date Wed, 18 Jan 2017 11:41:50 +0100
parents 981339d774b8
children faecbb446a04
comparison
equal deleted inserted replaced
1278:cb9609380056 1279:291df0037835
11 */ 11 */
12 Ext.define('Lada.controller.grid.Ortszuordnung', { 12 Ext.define('Lada.controller.grid.Ortszuordnung', {
13 extend: 'Ext.app.Controller', 13 extend: 'Ext.app.Controller',
14 14
15 requires: [ 15 requires: [
16 'Lada.view.window.Ortszuordnung' 16 'Lada.view.window.Ortszuordnung',
17 'Lada.view.form.Ortserstellung'
17 ], 18 ],
18 19
19 /** 20 /**
20 * Inhitialize the controller 21 * Inhitialize the controller
21 * It has 3 listeners 22 * It has 3 listeners
28 'ortszuordnunggrid button[action=add]': { 29 'ortszuordnunggrid button[action=add]': {
29 click: this.add 30 click: this.add
30 }, 31 },
31 'ortszuordnunggrid button[action=delete]': { 32 'ortszuordnunggrid button[action=delete]': {
32 click: this.remove 33 click: this.remove
34 },
35 'ortszuordnungwindow toolbar button[action=createort]':{
36 click: this.createort
37 },
38 'ortszuordnungwindow toolbar button[action=frommap]':{
39 click: this.frommap
40 },
41 'ortszuordnungwindow toolbar button[action=clone]':{
42 click: this.cloneort
33 } 43 }
34 }); 44 });
35 }, 45 },
36 46
37 /** 47 /**
40 */ 50 */
41 open: function(grid, record) { 51 open: function(grid, record) {
42 var probe = grid.up('window').record; 52 var probe = grid.up('window').record;
43 var win = Ext.create('Lada.view.window.Ortszuordnung', { 53 var win = Ext.create('Lada.view.window.Ortszuordnung', {
44 parentWindow: grid.up('window'), 54 parentWindow: grid.up('window'),
45 probe: grid.up('window').down('probeform').record, 55 probe: probe,
46 record: record, 56 record: record,
47 grid: grid 57 grid: grid
48 }); 58 });
49 win.show(); 59 win.show();
50 win.initData(); 60 win.initData();
101 } 111 }
102 }); 112 });
103 } 113 }
104 }); 114 });
105 grid.down('button[action=delete]').disable(); 115 grid.down('button[action=delete]').disable();
116 },
117
118 /**
119 * Opens the form for a new Messpunkt
120 */
121 createort: function() {
122 Ext.create('Lada.view.form.Ortserstellung').show();
123 },
124
125 /**
126 *
127 * Opens the form for a new Messpunkt, with prefilled coordinates.
128 * TODO Not functional yet
129 */
130 frommap: function(button) {
131 var map = button.up('ortszuordnungwindow').down('map');
132 // map.getClick();
133 //TODO: wait for click return
134 Ext.create('Lada.view.form.Ortserstellung', {
135 presets: {
136 kda_id: 4,
137 koord_x_extern: 35000000, //TODO dummy values
138 koord_y_extern: 1000000
139 }
140 }).show();
141 },
142
143 /**
144 * Opens the form for a new Messpunkt, with all values prefilled from the currently
145 * selected item
146 */
147 cloneort: function(button) {
148 var grid = button.up('ortszuordnungwindow').down('ortstammdatengrid').getView();
149 var selected = grid.getSelectionModel().getSelection()[0];
150 Ext.create('Lada.view.form.Ortserstellung', {
151 presets: selected.data
152 }).show();
106 } 153 }
107 }); 154 });

http://lada.wald.intevation.org