annotate app/controller/grid/Ortszuordnung.js @ 1421:ca9bea97b2f4

Added tag 2.6.1 for changeset 48c9c7b0ceef
author Michael Stanko <mstanko@bfs.de>
date Wed, 05 Apr 2017 16:04:20 +0200
parents e98ec562764f
children
rev   line source
587
cf328526b5bb Moved controller into subfolders.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
1 /* Copyright (C) 2013 by Bundesamt fuer Strahlenschutz
cf328526b5bb Moved controller into subfolders.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
2 * Software engineering by Intevation GmbH
cf328526b5bb Moved controller into subfolders.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
3 *
cf328526b5bb Moved controller into subfolders.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
4 * This file is Free Software under the GNU GPL (v>=3)
cf328526b5bb Moved controller into subfolders.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
5 * and comes with ABSOLUTELY NO WARRANTY! Check out
cf328526b5bb Moved controller into subfolders.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
6 * the documentation coming with IMIS-Labordaten-Application for details.
cf328526b5bb Moved controller into subfolders.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
7 */
cf328526b5bb Moved controller into subfolders.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
8
742
6e28ebbe1a73 added documentation for Form and Grid controllers
Dustin Demuth <dustin@intevation.de>
parents: 701
diff changeset
9 /**
6e28ebbe1a73 added documentation for Form and Grid controllers
Dustin Demuth <dustin@intevation.de>
parents: 701
diff changeset
10 * This is a controller for a grid of Orte
6e28ebbe1a73 added documentation for Form and Grid controllers
Dustin Demuth <dustin@intevation.de>
parents: 701
diff changeset
11 */
1012
2adc329d90fe Replaced Locations with Ortszuordnung
Dustin Demuth <dustin@intevation.de>
parents: 826
diff changeset
12 Ext.define('Lada.controller.grid.Ortszuordnung', {
587
cf328526b5bb Moved controller into subfolders.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
13 extend: 'Ext.app.Controller',
cf328526b5bb Moved controller into subfolders.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
14
602
e1ab24758392 Updated the ort grid controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 587
diff changeset
15 requires: [
1279
291df0037835 Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents: 1051
diff changeset
16 'Lada.view.window.Ortszuordnung',
1288
08085b7d1d0b Ortszuordnung: Search, new orte, display and validity check
Maximilian Krambach <mkrambach@intevation.de>
parents: 1287
diff changeset
17 'Lada.view.window.Ortserstellung',
1287
e317ba349204 Added search for orte, verwaltungseinheiten and staaten.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1284
diff changeset
18 'Lada.view.window.OrtFilter'
602
e1ab24758392 Updated the ort grid controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 587
diff changeset
19 ],
e1ab24758392 Updated the ort grid controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 587
diff changeset
20
1287
e317ba349204 Added search for orte, verwaltungseinheiten and staaten.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1284
diff changeset
21 resultPanel: null,
e317ba349204 Added search for orte, verwaltungseinheiten and staaten.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1284
diff changeset
22 searchField: null,
e317ba349204 Added search for orte, verwaltungseinheiten and staaten.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1284
diff changeset
23
742
6e28ebbe1a73 added documentation for Form and Grid controllers
Dustin Demuth <dustin@intevation.de>
parents: 701
diff changeset
24 /**
1365
e98ec562764f Fixed grid selection in searchField in Ortszuordnungsgrid
Maximilian Krambach <mkrambach@intevation.de>
parents: 1361
diff changeset
25 * Initialize the controller
e98ec562764f Fixed grid selection in searchField in Ortszuordnungsgrid
Maximilian Krambach <mkrambach@intevation.de>
parents: 1361
diff changeset
26 * It has 10 listeners
742
6e28ebbe1a73 added documentation for Form and Grid controllers
Dustin Demuth <dustin@intevation.de>
parents: 701
diff changeset
27 */
587
cf328526b5bb Moved controller into subfolders.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
28 init: function() {
cf328526b5bb Moved controller into subfolders.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
29 this.control({
1012
2adc329d90fe Replaced Locations with Ortszuordnung
Dustin Demuth <dustin@intevation.de>
parents: 826
diff changeset
30 'ortszuordnunggrid': {
602
e1ab24758392 Updated the ort grid controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 587
diff changeset
31 itemdblclick: this.open
587
cf328526b5bb Moved controller into subfolders.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
32 },
1012
2adc329d90fe Replaced Locations with Ortszuordnung
Dustin Demuth <dustin@intevation.de>
parents: 826
diff changeset
33 'ortszuordnunggrid button[action=add]': {
587
cf328526b5bb Moved controller into subfolders.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
34 click: this.add
cf328526b5bb Moved controller into subfolders.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
35 },
1012
2adc329d90fe Replaced Locations with Ortszuordnung
Dustin Demuth <dustin@intevation.de>
parents: 826
diff changeset
36 'ortszuordnunggrid button[action=delete]': {
587
cf328526b5bb Moved controller into subfolders.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
37 click: this.remove
1279
291df0037835 Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents: 1051
diff changeset
38 },
291df0037835 Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents: 1051
diff changeset
39 'ortszuordnungwindow toolbar button[action=createort]':{
291df0037835 Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents: 1051
diff changeset
40 click: this.createort
291df0037835 Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents: 1051
diff changeset
41 },
291df0037835 Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents: 1051
diff changeset
42 'ortszuordnungwindow toolbar button[action=frommap]':{
291df0037835 Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents: 1051
diff changeset
43 click: this.frommap
291df0037835 Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents: 1051
diff changeset
44 },
291df0037835 Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents: 1051
diff changeset
45 'ortszuordnungwindow toolbar button[action=clone]':{
291df0037835 Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents: 1051
diff changeset
46 click: this.cloneort
1287
e317ba349204 Added search for orte, verwaltungseinheiten and staaten.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1284
diff changeset
47 },
e317ba349204 Added search for orte, verwaltungseinheiten and staaten.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1284
diff changeset
48 'ortszuordnungwindow toolbar textfield[name=search]': {
e317ba349204 Added search for orte, verwaltungseinheiten and staaten.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1284
diff changeset
49 keyup: this.search
e317ba349204 Added search for orte, verwaltungseinheiten and staaten.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1284
diff changeset
50 },
e317ba349204 Added search for orte, verwaltungseinheiten and staaten.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1284
diff changeset
51 'ortfilterwindow grid[name=messpunkte]': {
1305
3754111e365a Changed selection in ort filter from dblclick to click.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1304
diff changeset
52 itemclick: this.selectedMesspunkt
1287
e317ba349204 Added search for orte, verwaltungseinheiten and staaten.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1284
diff changeset
53 },
e317ba349204 Added search for orte, verwaltungseinheiten and staaten.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1284
diff changeset
54 'ortfilterwindow grid[name=verwaltungseinheiten]': {
1305
3754111e365a Changed selection in ort filter from dblclick to click.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1304
diff changeset
55 itemclick: this.selectedVerwaltungseinheit
1287
e317ba349204 Added search for orte, verwaltungseinheiten and staaten.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1284
diff changeset
56 },
e317ba349204 Added search for orte, verwaltungseinheiten and staaten.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1284
diff changeset
57 'ortfilterwindow grid[name=staaten]': {
1305
3754111e365a Changed selection in ort filter from dblclick to click.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1304
diff changeset
58 itemclick: this.selectedStaat
587
cf328526b5bb Moved controller into subfolders.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
59 }
cf328526b5bb Moved controller into subfolders.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
60 });
cf328526b5bb Moved controller into subfolders.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
61 },
cf328526b5bb Moved controller into subfolders.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
62
742
6e28ebbe1a73 added documentation for Form and Grid controllers
Dustin Demuth <dustin@intevation.de>
parents: 701
diff changeset
63 /**
1013
75ce503ab296 Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents: 1012
diff changeset
64 * When open is called, a {@link Lada.view.window.Ortszuordnung}
1289
bfdc00c24baf Ortszuordnung for messprogramm and probe using same form
Maximilian Krambach <mkrambach@intevation.de>
parents: 1288
diff changeset
65 * is created which allows to edit the Orte. record is an ortszuordnung
bfdc00c24baf Ortszuordnung for messprogramm and probe using same form
Maximilian Krambach <mkrambach@intevation.de>
parents: 1288
diff changeset
66 * or ortzuordnungMp
742
6e28ebbe1a73 added documentation for Form and Grid controllers
Dustin Demuth <dustin@intevation.de>
parents: 701
diff changeset
67 */
602
e1ab24758392 Updated the ort grid controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 587
diff changeset
68 open: function(grid, record) {
1289
bfdc00c24baf Ortszuordnung for messprogramm and probe using same form
Maximilian Krambach <mkrambach@intevation.de>
parents: 1288
diff changeset
69 var parent = grid.up('window').record;
bfdc00c24baf Ortszuordnung for messprogramm and probe using same form
Maximilian Krambach <mkrambach@intevation.de>
parents: 1288
diff changeset
70 // parent is either probe or messprogramm.
bfdc00c24baf Ortszuordnung for messprogramm and probe using same form
Maximilian Krambach <mkrambach@intevation.de>
parents: 1288
diff changeset
71 var parentisMp = false;
bfdc00c24baf Ortszuordnung for messprogramm and probe using same form
Maximilian Krambach <mkrambach@intevation.de>
parents: 1288
diff changeset
72 if (parent.data.hauptprobenNr === undefined) {
bfdc00c24baf Ortszuordnung for messprogramm and probe using same form
Maximilian Krambach <mkrambach@intevation.de>
parents: 1288
diff changeset
73 parentisMp = true;
bfdc00c24baf Ortszuordnung for messprogramm and probe using same form
Maximilian Krambach <mkrambach@intevation.de>
parents: 1288
diff changeset
74 }
1013
75ce503ab296 Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents: 1012
diff changeset
75 var win = Ext.create('Lada.view.window.Ortszuordnung', {
690
e88381fb3bdb Use treeModiefied timestamp to determine if working with 'old' objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 644
diff changeset
76 parentWindow: grid.up('window'),
1289
bfdc00c24baf Ortszuordnung for messprogramm and probe using same form
Maximilian Krambach <mkrambach@intevation.de>
parents: 1288
diff changeset
77 probe: parentisMp ? null: parent,
bfdc00c24baf Ortszuordnung for messprogramm and probe using same form
Maximilian Krambach <mkrambach@intevation.de>
parents: 1288
diff changeset
78 messprogramm: parentisMp ? parent: null,
1028
2e7adc19b4fe Do not copy the Record to the Ortszuordnungwin
Dustin Demuth <dustin@intevation.de>
parents: 1022
diff changeset
79 record: record,
644
71e8b84d7829 Reload grids on messung or ort changed/added.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 643
diff changeset
80 grid: grid
587
cf328526b5bb Moved controller into subfolders.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
81 });
602
e1ab24758392 Updated the ort grid controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 587
diff changeset
82 win.show();
e1ab24758392 Updated the ort grid controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 587
diff changeset
83 win.initData();
587
cf328526b5bb Moved controller into subfolders.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
84 },
cf328526b5bb Moved controller into subfolders.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
85
742
6e28ebbe1a73 added documentation for Form and Grid controllers
Dustin Demuth <dustin@intevation.de>
parents: 701
diff changeset
86 /**
6e28ebbe1a73 added documentation for Form and Grid controllers
Dustin Demuth <dustin@intevation.de>
parents: 701
diff changeset
87 * This function adds a new row to add an Ort
6e28ebbe1a73 added documentation for Form and Grid controllers
Dustin Demuth <dustin@intevation.de>
parents: 701
diff changeset
88 */
643
477379250512 Open the ort create window on button click.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 602
diff changeset
89 add: function(button) {
1289
bfdc00c24baf Ortszuordnung for messprogramm and probe using same form
Maximilian Krambach <mkrambach@intevation.de>
parents: 1288
diff changeset
90 var parent = button.up('window').record;
bfdc00c24baf Ortszuordnung for messprogramm and probe using same form
Maximilian Krambach <mkrambach@intevation.de>
parents: 1288
diff changeset
91 var parentisMp = false;
bfdc00c24baf Ortszuordnung for messprogramm and probe using same form
Maximilian Krambach <mkrambach@intevation.de>
parents: 1288
diff changeset
92 if (parent.data.hauptprobenNr === undefined) {
bfdc00c24baf Ortszuordnung for messprogramm and probe using same form
Maximilian Krambach <mkrambach@intevation.de>
parents: 1288
diff changeset
93 parentisMp = true;
bfdc00c24baf Ortszuordnung for messprogramm and probe using same form
Maximilian Krambach <mkrambach@intevation.de>
parents: 1288
diff changeset
94 }
1013
75ce503ab296 Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents: 1012
diff changeset
95 var win = Ext.create('Lada.view.window.Ortszuordnung', {
75ce503ab296 Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents: 1012
diff changeset
96 parentWindow: button.up('window'),
1289
bfdc00c24baf Ortszuordnung for messprogramm and probe using same form
Maximilian Krambach <mkrambach@intevation.de>
parents: 1288
diff changeset
97 probe: parentisMp ? null: parent,
bfdc00c24baf Ortszuordnung for messprogramm and probe using same form
Maximilian Krambach <mkrambach@intevation.de>
parents: 1288
diff changeset
98 messprogramm: parentisMp ? parent: null,
1013
75ce503ab296 Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents: 1012
diff changeset
99 record: null,
1012
2adc329d90fe Replaced Locations with Ortszuordnung
Dustin Demuth <dustin@intevation.de>
parents: 826
diff changeset
100 grid: button.up('ortszuordnung')
643
477379250512 Open the ort create window on button click.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 602
diff changeset
101 });
477379250512 Open the ort create window on button click.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 602
diff changeset
102 win.show();
477379250512 Open the ort create window on button click.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 602
diff changeset
103 win.initData();
587
cf328526b5bb Moved controller into subfolders.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
104 },
cf328526b5bb Moved controller into subfolders.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
105
742
6e28ebbe1a73 added documentation for Form and Grid controllers
Dustin Demuth <dustin@intevation.de>
parents: 701
diff changeset
106 /**
6e28ebbe1a73 added documentation for Form and Grid controllers
Dustin Demuth <dustin@intevation.de>
parents: 701
diff changeset
107 * A Ort-row can be removed from the grid with the remove
6e28ebbe1a73 added documentation for Form and Grid controllers
Dustin Demuth <dustin@intevation.de>
parents: 701
diff changeset
108 * function. It asks the user for confirmation
6e28ebbe1a73 added documentation for Form and Grid controllers
Dustin Demuth <dustin@intevation.de>
parents: 701
diff changeset
109 * If the removal was confirmed, it reloads the parent window on success,
6e28ebbe1a73 added documentation for Form and Grid controllers
Dustin Demuth <dustin@intevation.de>
parents: 701
diff changeset
110 * on failure, an error message is shown.
6e28ebbe1a73 added documentation for Form and Grid controllers
Dustin Demuth <dustin@intevation.de>
parents: 701
diff changeset
111 */
587
cf328526b5bb Moved controller into subfolders.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
112 remove: function(button) {
cf328526b5bb Moved controller into subfolders.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
113 var grid = button.up('grid');
cf328526b5bb Moved controller into subfolders.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
114 var selection = grid.getView().getSelectionModel().getSelection()[0];
1012
2adc329d90fe Replaced Locations with Ortszuordnung
Dustin Demuth <dustin@intevation.de>
parents: 826
diff changeset
115 var i18n = Lada.getApplication().bundle;
2adc329d90fe Replaced Locations with Ortszuordnung
Dustin Demuth <dustin@intevation.de>
parents: 826
diff changeset
116 Ext.MessageBox.confirm(i18n.getMsg('delete'), i18n.getMsg('confirmation.question'),
2adc329d90fe Replaced Locations with Ortszuordnung
Dustin Demuth <dustin@intevation.de>
parents: 826
diff changeset
117 function(btn) {
2adc329d90fe Replaced Locations with Ortszuordnung
Dustin Demuth <dustin@intevation.de>
parents: 826
diff changeset
118 if (btn === 'yes') {
587
cf328526b5bb Moved controller into subfolders.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
119 selection.destroy({
cf328526b5bb Moved controller into subfolders.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
120 success: function() {
cf328526b5bb Moved controller into subfolders.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
121 button.up('window').initData();
cf328526b5bb Moved controller into subfolders.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
122 },
701
f0bc5387abcc Added failure - Messages
Dustin Demuth <dustin@intevation.de>
parents: 690
diff changeset
123 failure: function(request, response) {
1012
2adc329d90fe Replaced Locations with Ortszuordnung
Dustin Demuth <dustin@intevation.de>
parents: 826
diff changeset
124 var i18n = Lada.getApplication().bundle;
701
f0bc5387abcc Added failure - Messages
Dustin Demuth <dustin@intevation.de>
parents: 690
diff changeset
125 var json = response.request.scope.reader.jsonData;
f0bc5387abcc Added failure - Messages
Dustin Demuth <dustin@intevation.de>
parents: 690
diff changeset
126 if (json) {
f0bc5387abcc Added failure - Messages
Dustin Demuth <dustin@intevation.de>
parents: 690
diff changeset
127 if (json.message){
1012
2adc329d90fe Replaced Locations with Ortszuordnung
Dustin Demuth <dustin@intevation.de>
parents: 826
diff changeset
128 Ext.Msg.alert(i18n.getMsg('err.msg.delete.title')
701
f0bc5387abcc Added failure - Messages
Dustin Demuth <dustin@intevation.de>
parents: 690
diff changeset
129 +' #'+json.message,
1012
2adc329d90fe Replaced Locations with Ortszuordnung
Dustin Demuth <dustin@intevation.de>
parents: 826
diff changeset
130 i18n.getMsg(json.message));
701
f0bc5387abcc Added failure - Messages
Dustin Demuth <dustin@intevation.de>
parents: 690
diff changeset
131 } else {
1012
2adc329d90fe Replaced Locations with Ortszuordnung
Dustin Demuth <dustin@intevation.de>
parents: 826
diff changeset
132 Ext.Msg.alert(i18n.getMsg('err.msg.delete.title'),
2adc329d90fe Replaced Locations with Ortszuordnung
Dustin Demuth <dustin@intevation.de>
parents: 826
diff changeset
133 i18n.getMsg('err.msg.generic.body'));
701
f0bc5387abcc Added failure - Messages
Dustin Demuth <dustin@intevation.de>
parents: 690
diff changeset
134 }
f0bc5387abcc Added failure - Messages
Dustin Demuth <dustin@intevation.de>
parents: 690
diff changeset
135 } else {
1012
2adc329d90fe Replaced Locations with Ortszuordnung
Dustin Demuth <dustin@intevation.de>
parents: 826
diff changeset
136 Ext.Msg.alert(i18n.getMsg('err.msg.delete.title'),
2adc329d90fe Replaced Locations with Ortszuordnung
Dustin Demuth <dustin@intevation.de>
parents: 826
diff changeset
137 i18n.getMsg('err.msg.response.body'));
701
f0bc5387abcc Added failure - Messages
Dustin Demuth <dustin@intevation.de>
parents: 690
diff changeset
138 }
587
cf328526b5bb Moved controller into subfolders.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
139 }
cf328526b5bb Moved controller into subfolders.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
140 });
cf328526b5bb Moved controller into subfolders.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
141 }
cf328526b5bb Moved controller into subfolders.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
142 });
826
2362f8ab1e9f disable remove button after a item is deleted from grid
Dustin Demuth <dustin@intevation.de>
parents: 742
diff changeset
143 grid.down('button[action=delete]').disable();
1279
291df0037835 Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents: 1051
diff changeset
144 },
291df0037835 Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents: 1051
diff changeset
145
291df0037835 Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents: 1051
diff changeset
146 /**
291df0037835 Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents: 1051
diff changeset
147 * Opens the form for a new Messpunkt
291df0037835 Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents: 1051
diff changeset
148 */
1288
08085b7d1d0b Ortszuordnung: Search, new orte, display and validity check
Maximilian Krambach <mkrambach@intevation.de>
parents: 1287
diff changeset
149 createort: function(button) {
08085b7d1d0b Ortszuordnung: Search, new orte, display and validity check
Maximilian Krambach <mkrambach@intevation.de>
parents: 1287
diff changeset
150 Ext.create('Lada.view.window.Ortserstellung',{
1333
af169bcb67df preselect ortTyp on Ortserstellugnswindow
Maximilian Krambach <mkrambach@intevation.de>
parents: 1322
diff changeset
151 record: Ext.create('Lada.model.Ort', {ortTyp: 1}),
1288
08085b7d1d0b Ortszuordnung: Search, new orte, display and validity check
Maximilian Krambach <mkrambach@intevation.de>
parents: 1287
diff changeset
152 parentWindow: button.up('ortszuordnungwindow')
08085b7d1d0b Ortszuordnung: Search, new orte, display and validity check
Maximilian Krambach <mkrambach@intevation.de>
parents: 1287
diff changeset
153 }).show();
1279
291df0037835 Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents: 1051
diff changeset
154 },
291df0037835 Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents: 1051
diff changeset
155
291df0037835 Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents: 1051
diff changeset
156 /**
1361
5c2d6812d85a Merge behaviour of Stammdaten panel and ortszuordnungs grid
Maximilian Krambach <mkrambach@intevation.de>
parents: 1344
diff changeset
157 * Creates a new Ortrecord from map coordinates
1279
291df0037835 Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents: 1051
diff changeset
158 */
291df0037835 Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents: 1051
diff changeset
159 frommap: function(button) {
291df0037835 Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents: 1051
diff changeset
160 var map = button.up('ortszuordnungwindow').down('map');
1361
5c2d6812d85a Merge behaviour of Stammdaten panel and ortszuordnungs grid
Maximilian Krambach <mkrambach@intevation.de>
parents: 1344
diff changeset
161 var record = Ext.create('Lada.model.Ort');
5c2d6812d85a Merge behaviour of Stammdaten panel and ortszuordnungs grid
Maximilian Krambach <mkrambach@intevation.de>
parents: 1344
diff changeset
162 map.activateDraw(record);
1279
291df0037835 Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents: 1051
diff changeset
163 },
291df0037835 Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents: 1051
diff changeset
164
291df0037835 Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents: 1051
diff changeset
165 /**
291df0037835 Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents: 1051
diff changeset
166 * Opens the form for a new Messpunkt, with all values prefilled from the currently
291df0037835 Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents: 1051
diff changeset
167 * selected item
291df0037835 Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents: 1051
diff changeset
168 */
291df0037835 Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents: 1051
diff changeset
169 cloneort: function(button) {
291df0037835 Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents: 1051
diff changeset
170 var grid = button.up('ortszuordnungwindow').down('ortstammdatengrid').getView();
291df0037835 Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents: 1051
diff changeset
171 var selected = grid.getSelectionModel().getSelection()[0];
1309
1bcc3a62e909 insert and preset OrtId field on Orterstellung
Maximilian Krambach <mkrambach@intevation.de>
parents: 1305
diff changeset
172 var newRecord = Ext.create('Lada.model.Ort', selected.data);
1314
8ace34d9352a changed behaviour of ortserstellung window on save; fix update (form)
Maximilian Krambach <mkrambach@intevation.de>
parents: 1309
diff changeset
173 newRecord.set('ortId', null);
8ace34d9352a changed behaviour of ortserstellung window on save; fix update (form)
Maximilian Krambach <mkrambach@intevation.de>
parents: 1309
diff changeset
174 newRecord.set('id', null);
1309
1bcc3a62e909 insert and preset OrtId field on Orterstellung
Maximilian Krambach <mkrambach@intevation.de>
parents: 1305
diff changeset
175 Ext.create('Lada.view.window.Ortserstellung', {
1bcc3a62e909 insert and preset OrtId field on Orterstellung
Maximilian Krambach <mkrambach@intevation.de>
parents: 1305
diff changeset
176 record: newRecord,
1288
08085b7d1d0b Ortszuordnung: Search, new orte, display and validity check
Maximilian Krambach <mkrambach@intevation.de>
parents: 1287
diff changeset
177 parentWindow: button.up('ortszuordnungwindow')
08085b7d1d0b Ortszuordnung: Search, new orte, display and validity check
Maximilian Krambach <mkrambach@intevation.de>
parents: 1287
diff changeset
178 }).show();
08085b7d1d0b Ortszuordnung: Search, new orte, display and validity check
Maximilian Krambach <mkrambach@intevation.de>
parents: 1287
diff changeset
179 },
08085b7d1d0b Ortszuordnung: Search, new orte, display and validity check
Maximilian Krambach <mkrambach@intevation.de>
parents: 1287
diff changeset
180
08085b7d1d0b Ortszuordnung: Search, new orte, display and validity check
Maximilian Krambach <mkrambach@intevation.de>
parents: 1287
diff changeset
181 /**
1287
e317ba349204 Added search for orte, verwaltungseinheiten and staaten.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1284
diff changeset
182 * Search triggered by textfield key event.
1284
faecbb446a04 Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents: 1279
diff changeset
183 */
1287
e317ba349204 Added search for orte, verwaltungseinheiten and staaten.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1284
diff changeset
184 search: function(field, evt, opts) {
1304
9f15a932a525 Fixed ort filter close actions.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1291
diff changeset
185 if (evt.getKey() === 27) {
9f15a932a525 Fixed ort filter close actions.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1291
diff changeset
186 if (this.resultPanel.isVisible()) {
9f15a932a525 Fixed ort filter close actions.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1291
diff changeset
187 this.resultPanel.close();
1322
6edab3ee2198 filter orte in a separate store.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1314
diff changeset
188 verwaltungseinheiten.clearFilter(true);
6edab3ee2198 filter orte in a separate store.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1314
diff changeset
189 staaten.clearFilter(true);
1304
9f15a932a525 Fixed ort filter close actions.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1291
diff changeset
190 return;
9f15a932a525 Fixed ort filter close actions.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1291
diff changeset
191 }
9f15a932a525 Fixed ort filter close actions.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1291
diff changeset
192 else {
9f15a932a525 Fixed ort filter close actions.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1291
diff changeset
193 field.up('window').close();
9f15a932a525 Fixed ort filter close actions.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1291
diff changeset
194 return;
9f15a932a525 Fixed ort filter close actions.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1291
diff changeset
195 }
9f15a932a525 Fixed ort filter close actions.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1291
diff changeset
196 }
1287
e317ba349204 Added search for orte, verwaltungseinheiten and staaten.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1284
diff changeset
197 this.searchField = field;
e317ba349204 Added search for orte, verwaltungseinheiten and staaten.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1284
diff changeset
198 if ((evt.getKey() == 13 || evt.getKey() == 8) && field.getValue() && field.getValue().length > 0) {
e317ba349204 Added search for orte, verwaltungseinheiten and staaten.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1284
diff changeset
199 this.execSearch(field, field.getValue());
e317ba349204 Added search for orte, verwaltungseinheiten and staaten.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1284
diff changeset
200 }
e317ba349204 Added search for orte, verwaltungseinheiten and staaten.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1284
diff changeset
201 if (field.getValue().length === 0) {
e317ba349204 Added search for orte, verwaltungseinheiten and staaten.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1284
diff changeset
202 this.resultPanel.hide();
1344
195c5d9b234b Clear filters for stores.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1342
diff changeset
203 var verwaltungseinheiten = Ext.data.StoreManager.get('verwaltungseinheiten');
195c5d9b234b Clear filters for stores.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1342
diff changeset
204 var staaten = Ext.data.StoreManager.get('staaten');
1322
6edab3ee2198 filter orte in a separate store.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1314
diff changeset
205 verwaltungseinheiten.clearFilter(true);
6edab3ee2198 filter orte in a separate store.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1314
diff changeset
206 staaten.clearFilter(true);
1287
e317ba349204 Added search for orte, verwaltungseinheiten and staaten.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1284
diff changeset
207 return;
e317ba349204 Added search for orte, verwaltungseinheiten and staaten.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1284
diff changeset
208 }
e317ba349204 Added search for orte, verwaltungseinheiten and staaten.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1284
diff changeset
209 if (field.getValue().length < 3) {
e317ba349204 Added search for orte, verwaltungseinheiten and staaten.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1284
diff changeset
210 return;
e317ba349204 Added search for orte, verwaltungseinheiten and staaten.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1284
diff changeset
211 }
e317ba349204 Added search for orte, verwaltungseinheiten and staaten.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1284
diff changeset
212 this.execSearch(field, field.getValue());
e317ba349204 Added search for orte, verwaltungseinheiten and staaten.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1284
diff changeset
213 },
e317ba349204 Added search for orte, verwaltungseinheiten and staaten.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1284
diff changeset
214
e317ba349204 Added search for orte, verwaltungseinheiten and staaten.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1284
diff changeset
215 /*
e317ba349204 Added search for orte, verwaltungseinheiten and staaten.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1284
diff changeset
216 * Execute search in stores (ort, verwaltungseinheit and staat) and
e317ba349204 Added search for orte, verwaltungseinheiten and staaten.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1284
diff changeset
217 * display the resultset.
e317ba349204 Added search for orte, verwaltungseinheiten and staaten.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1284
diff changeset
218 */
e317ba349204 Added search for orte, verwaltungseinheiten and staaten.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1284
diff changeset
219 execSearch: function(field, filter) {
e317ba349204 Added search for orte, verwaltungseinheiten and staaten.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1284
diff changeset
220 // Filter stores
e317ba349204 Added search for orte, verwaltungseinheiten and staaten.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1284
diff changeset
221 var messpunkte = Ext.data.StoreManager.get('orte');
1322
6edab3ee2198 filter orte in a separate store.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1314
diff changeset
222 var cloneRecords = [];
6edab3ee2198 filter orte in a separate store.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1314
diff changeset
223 messpunkte.each(function(r) {
6edab3ee2198 filter orte in a separate store.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1314
diff changeset
224 cloneRecords.push(r.copy());
6edab3ee2198 filter orte in a separate store.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1314
diff changeset
225 });
6edab3ee2198 filter orte in a separate store.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1314
diff changeset
226 var filterMesspunkte = Ext.create('Lada.store.Orte',{
6edab3ee2198 filter orte in a separate store.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1314
diff changeset
227 autoLoad: false
6edab3ee2198 filter orte in a separate store.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1314
diff changeset
228 });
6edab3ee2198 filter orte in a separate store.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1314
diff changeset
229 filterMesspunkte.add(cloneRecords);
1287
e317ba349204 Added search for orte, verwaltungseinheiten and staaten.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1284
diff changeset
230 var verwaltungseinheiten = Ext.data.StoreManager.get('verwaltungseinheiten');
e317ba349204 Added search for orte, verwaltungseinheiten and staaten.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1284
diff changeset
231 var staaten = Ext.data.StoreManager.get('staaten');
e317ba349204 Added search for orte, verwaltungseinheiten and staaten.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1284
diff changeset
232 verwaltungseinheiten.clearFilter(true);
e317ba349204 Added search for orte, verwaltungseinheiten and staaten.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1284
diff changeset
233 staaten.clearFilter(true);
1322
6edab3ee2198 filter orte in a separate store.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1314
diff changeset
234 filterMesspunkte.filter({filterFn: function(item) {
1287
e317ba349204 Added search for orte, verwaltungseinheiten and staaten.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1284
diff changeset
235 if (item.get('ortId').indexOf(filter) > -1) {
e317ba349204 Added search for orte, verwaltungseinheiten and staaten.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1284
diff changeset
236 return true;
e317ba349204 Added search for orte, verwaltungseinheiten and staaten.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1284
diff changeset
237 }
e317ba349204 Added search for orte, verwaltungseinheiten and staaten.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1284
diff changeset
238 if (item.get('kurztext').indexOf(filter) > -1) {
e317ba349204 Added search for orte, verwaltungseinheiten and staaten.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1284
diff changeset
239 return true;
e317ba349204 Added search for orte, verwaltungseinheiten and staaten.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1284
diff changeset
240 }
e317ba349204 Added search for orte, verwaltungseinheiten and staaten.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1284
diff changeset
241 if (item.get('langtext').indexOf(filter) > -1) {
e317ba349204 Added search for orte, verwaltungseinheiten and staaten.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1284
diff changeset
242 return true;
e317ba349204 Added search for orte, verwaltungseinheiten and staaten.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1284
diff changeset
243 }
e317ba349204 Added search for orte, verwaltungseinheiten and staaten.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1284
diff changeset
244 if (item.get('berichtstext') &&
e317ba349204 Added search for orte, verwaltungseinheiten and staaten.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1284
diff changeset
245 item.get('berichtstext').indexOf(filter) > -1) {
e317ba349204 Added search for orte, verwaltungseinheiten and staaten.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1284
diff changeset
246 return true;
e317ba349204 Added search for orte, verwaltungseinheiten and staaten.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1284
diff changeset
247 }
1309
1bcc3a62e909 insert and preset OrtId field on Orterstellung
Maximilian Krambach <mkrambach@intevation.de>
parents: 1305
diff changeset
248 if (item.get('gemId') &&
1bcc3a62e909 insert and preset OrtId field on Orterstellung
Maximilian Krambach <mkrambach@intevation.de>
parents: 1305
diff changeset
249 item.get('gemId').indexOf(filter) > -1) {
1287
e317ba349204 Added search for orte, verwaltungseinheiten and staaten.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1284
diff changeset
250 return true;
e317ba349204 Added search for orte, verwaltungseinheiten and staaten.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1284
diff changeset
251 }
e317ba349204 Added search for orte, verwaltungseinheiten and staaten.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1284
diff changeset
252 }});
e317ba349204 Added search for orte, verwaltungseinheiten and staaten.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1284
diff changeset
253 verwaltungseinheiten.filter('bezeichnung', filter);
e317ba349204 Added search for orte, verwaltungseinheiten and staaten.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1284
diff changeset
254 staaten.filter('staat', filter);
e317ba349204 Added search for orte, verwaltungseinheiten and staaten.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1284
diff changeset
255
e317ba349204 Added search for orte, verwaltungseinheiten and staaten.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1284
diff changeset
256 if (!this.resultPanel) {
e317ba349204 Added search for orte, verwaltungseinheiten and staaten.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1284
diff changeset
257 this.resultPanel = Ext.create('Lada.view.window.OrtFilter', {
e317ba349204 Added search for orte, verwaltungseinheiten and staaten.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1284
diff changeset
258 x: 500,
e317ba349204 Added search for orte, verwaltungseinheiten and staaten.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1284
diff changeset
259 y: 500,
1289
bfdc00c24baf Ortszuordnung for messprogramm and probe using same form
Maximilian Krambach <mkrambach@intevation.de>
parents: 1288
diff changeset
260 alwaysOnTop: true,
bfdc00c24baf Ortszuordnung for messprogramm and probe using same form
Maximilian Krambach <mkrambach@intevation.de>
parents: 1288
diff changeset
261 parentWindow: this
1287
e317ba349204 Added search for orte, verwaltungseinheiten and staaten.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1284
diff changeset
262 });
e317ba349204 Added search for orte, verwaltungseinheiten and staaten.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1284
diff changeset
263 }
e317ba349204 Added search for orte, verwaltungseinheiten and staaten.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1284
diff changeset
264 this.resultPanel.show();
1322
6edab3ee2198 filter orte in a separate store.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1314
diff changeset
265 this.resultPanel.updateGrids(filterMesspunkte, verwaltungseinheiten, staaten);
1287
e317ba349204 Added search for orte, verwaltungseinheiten and staaten.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1284
diff changeset
266 this.resultPanel.reposition(field.getX() + field.getLabelWidth(), field.getY());
e317ba349204 Added search for orte, verwaltungseinheiten and staaten.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1284
diff changeset
267 field.focus();
e317ba349204 Added search for orte, verwaltungseinheiten and staaten.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1284
diff changeset
268 },
e317ba349204 Added search for orte, verwaltungseinheiten and staaten.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1284
diff changeset
269
e317ba349204 Added search for orte, verwaltungseinheiten and staaten.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1284
diff changeset
270 selectedMesspunkt: function(grid, record) {
e317ba349204 Added search for orte, verwaltungseinheiten and staaten.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1284
diff changeset
271 var win = grid.up('window');
e317ba349204 Added search for orte, verwaltungseinheiten and staaten.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1284
diff changeset
272 win.hide();
e317ba349204 Added search for orte, verwaltungseinheiten and staaten.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1284
diff changeset
273 this.searchField.reset();
e317ba349204 Added search for orte, verwaltungseinheiten and staaten.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1284
diff changeset
274 var grid = this.searchField.up('panel').down('ortstammdatengrid');
1365
e98ec562764f Fixed grid selection in searchField in Ortszuordnungsgrid
Maximilian Krambach <mkrambach@intevation.de>
parents: 1361
diff changeset
275 var newrecord = grid.store.getById(record.get('id'));
e98ec562764f Fixed grid selection in searchField in Ortszuordnungsgrid
Maximilian Krambach <mkrambach@intevation.de>
parents: 1361
diff changeset
276 grid.getView().getSelectionModel().select(newrecord);
1287
e317ba349204 Added search for orte, verwaltungseinheiten and staaten.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1284
diff changeset
277 grid.getView().focusRow(record);
1344
195c5d9b234b Clear filters for stores.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1342
diff changeset
278 var verwaltungseinheiten = Ext.data.StoreManager.get('verwaltungseinheiten');
195c5d9b234b Clear filters for stores.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1342
diff changeset
279 var staaten = Ext.data.StoreManager.get('staaten');
195c5d9b234b Clear filters for stores.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1342
diff changeset
280 verwaltungseinheiten.clearFilter(true);
195c5d9b234b Clear filters for stores.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1342
diff changeset
281 staaten.clearFilter(true);
1287
e317ba349204 Added search for orte, verwaltungseinheiten and staaten.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1284
diff changeset
282 },
e317ba349204 Added search for orte, verwaltungseinheiten and staaten.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1284
diff changeset
283
e317ba349204 Added search for orte, verwaltungseinheiten and staaten.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1284
diff changeset
284 selectedVerwaltungseinheit: function(grid, record) {
e317ba349204 Added search for orte, verwaltungseinheiten and staaten.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1284
diff changeset
285 var win = grid.up('window');
1289
bfdc00c24baf Ortszuordnung for messprogramm and probe using same form
Maximilian Krambach <mkrambach@intevation.de>
parents: 1288
diff changeset
286 var panel = this.searchField.up('panel').up('window');
1287
e317ba349204 Added search for orte, verwaltungseinheiten and staaten.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1284
diff changeset
287 win.hide();
e317ba349204 Added search for orte, verwaltungseinheiten and staaten.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1284
diff changeset
288 this.searchField.reset();
1288
08085b7d1d0b Ortszuordnung: Search, new orte, display and validity check
Maximilian Krambach <mkrambach@intevation.de>
parents: 1287
diff changeset
289 Ext.create('Lada.view.window.Ortserstellung', {
1289
bfdc00c24baf Ortszuordnung for messprogramm and probe using same form
Maximilian Krambach <mkrambach@intevation.de>
parents: 1288
diff changeset
290 record: Ext.create('Lada.model.Ort', {
1309
1bcc3a62e909 insert and preset OrtId field on Orterstellung
Maximilian Krambach <mkrambach@intevation.de>
parents: 1305
diff changeset
291 gemId: record.get('id'),
1bcc3a62e909 insert and preset OrtId field on Orterstellung
Maximilian Krambach <mkrambach@intevation.de>
parents: 1305
diff changeset
292 ortId: record.get('id'),
1bcc3a62e909 insert and preset OrtId field on Orterstellung
Maximilian Krambach <mkrambach@intevation.de>
parents: 1305
diff changeset
293 kurztext: record.get('bezeichnung'),
1bcc3a62e909 insert and preset OrtId field on Orterstellung
Maximilian Krambach <mkrambach@intevation.de>
parents: 1305
diff changeset
294 langtext: record.get('bezeichnung'),
1333
af169bcb67df preselect ortTyp on Ortserstellugnswindow
Maximilian Krambach <mkrambach@intevation.de>
parents: 1322
diff changeset
295 berichtstext: record.get('bezeichnung'),
af169bcb67df preselect ortTyp on Ortserstellugnswindow
Maximilian Krambach <mkrambach@intevation.de>
parents: 1322
diff changeset
296 ortTyp: 4
1289
bfdc00c24baf Ortszuordnung for messprogramm and probe using same form
Maximilian Krambach <mkrambach@intevation.de>
parents: 1288
diff changeset
297 }),
bfdc00c24baf Ortszuordnung for messprogramm and probe using same form
Maximilian Krambach <mkrambach@intevation.de>
parents: 1288
diff changeset
298 parentWindow: panel
1288
08085b7d1d0b Ortszuordnung: Search, new orte, display and validity check
Maximilian Krambach <mkrambach@intevation.de>
parents: 1287
diff changeset
299 }).show();
1344
195c5d9b234b Clear filters for stores.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1342
diff changeset
300 var verwaltungseinheiten = Ext.data.StoreManager.get('verwaltungseinheiten');
195c5d9b234b Clear filters for stores.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1342
diff changeset
301 var staaten = Ext.data.StoreManager.get('staaten');
195c5d9b234b Clear filters for stores.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1342
diff changeset
302 verwaltungseinheiten.clearFilter(true);
195c5d9b234b Clear filters for stores.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1342
diff changeset
303 staaten.clearFilter(true);
1287
e317ba349204 Added search for orte, verwaltungseinheiten and staaten.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1284
diff changeset
304 },
e317ba349204 Added search for orte, verwaltungseinheiten and staaten.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1284
diff changeset
305
e317ba349204 Added search for orte, verwaltungseinheiten and staaten.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1284
diff changeset
306 selectedStaat: function(grid, record) {
e317ba349204 Added search for orte, verwaltungseinheiten and staaten.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1284
diff changeset
307 var win = grid.up('window');
1342
d5e270fa91e4 fix: Ortserstellung for Staaten and validity check triggers
Maximilian Krambach <mkrambach@intevation.de>
parents: 1333
diff changeset
308 var panel = this.searchField.up('panel').up('window');
1287
e317ba349204 Added search for orte, verwaltungseinheiten and staaten.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1284
diff changeset
309 win.hide();
1289
bfdc00c24baf Ortszuordnung for messprogramm and probe using same form
Maximilian Krambach <mkrambach@intevation.de>
parents: 1288
diff changeset
310 this.searchField.reset();
1288
08085b7d1d0b Ortszuordnung: Search, new orte, display and validity check
Maximilian Krambach <mkrambach@intevation.de>
parents: 1287
diff changeset
311 Ext.create('Lada.view.window.Ortserstellung', {
1289
bfdc00c24baf Ortszuordnung for messprogramm and probe using same form
Maximilian Krambach <mkrambach@intevation.de>
parents: 1288
diff changeset
312 record: Ext.create('Lada.model.Ort', {
1309
1bcc3a62e909 insert and preset OrtId field on Orterstellung
Maximilian Krambach <mkrambach@intevation.de>
parents: 1305
diff changeset
313 staatId: record.get('id'),
1bcc3a62e909 insert and preset OrtId field on Orterstellung
Maximilian Krambach <mkrambach@intevation.de>
parents: 1305
diff changeset
314 ortId: 'Staat_' + record.get('staatIso'),
1bcc3a62e909 insert and preset OrtId field on Orterstellung
Maximilian Krambach <mkrambach@intevation.de>
parents: 1305
diff changeset
315 kurztext: record.get('staat'),
1bcc3a62e909 insert and preset OrtId field on Orterstellung
Maximilian Krambach <mkrambach@intevation.de>
parents: 1305
diff changeset
316 langtext: record.get('staat'),
1333
af169bcb67df preselect ortTyp on Ortserstellugnswindow
Maximilian Krambach <mkrambach@intevation.de>
parents: 1322
diff changeset
317 berichtstext: record.get('staat'),
af169bcb67df preselect ortTyp on Ortserstellugnswindow
Maximilian Krambach <mkrambach@intevation.de>
parents: 1322
diff changeset
318 ortTyp: 5
1289
bfdc00c24baf Ortszuordnung for messprogramm and probe using same form
Maximilian Krambach <mkrambach@intevation.de>
parents: 1288
diff changeset
319 }),
1342
d5e270fa91e4 fix: Ortserstellung for Staaten and validity check triggers
Maximilian Krambach <mkrambach@intevation.de>
parents: 1333
diff changeset
320 parentWindow: panel
1288
08085b7d1d0b Ortszuordnung: Search, new orte, display and validity check
Maximilian Krambach <mkrambach@intevation.de>
parents: 1287
diff changeset
321 }).show();
1344
195c5d9b234b Clear filters for stores.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1342
diff changeset
322 var verwaltungseinheiten = Ext.data.StoreManager.get('verwaltungseinheiten');
195c5d9b234b Clear filters for stores.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1342
diff changeset
323 var staaten = Ext.data.StoreManager.get('staaten');
195c5d9b234b Clear filters for stores.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1342
diff changeset
324 verwaltungseinheiten.clearFilter(true);
195c5d9b234b Clear filters for stores.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1342
diff changeset
325 staaten.clearFilter(true);
587
cf328526b5bb Moved controller into subfolders.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
326 }
cf328526b5bb Moved controller into subfolders.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
327 });

http://lada.wald.intevation.org