annotate app/view/window/MessprogrammOrt.js @ 1291:e9f812528324

ortszuordnung form changes removed discard button cursor change if new position is to be selected on map display of GemeindeId and Staat in ortzuordnung
author Maximilian Krambach <mkrambach@intevation.de>
date Wed, 01 Feb 2017 18:00:59 +0100
parents 08085b7d1d0b
children c1b7db04b39c
rev   line source
797
b8fd43021c29 Added a Window to alter Orte of a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
1 /* Copyright (C) 2013 by Bundesamt fuer Strahlenschutz
b8fd43021c29 Added a Window to alter Orte of a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
2 * Software engineering by Intevation GmbH
b8fd43021c29 Added a Window to alter Orte of a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
3 *
b8fd43021c29 Added a Window to alter Orte of a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
4 * This file is Free Software under the GNU GPL (v>=3)
b8fd43021c29 Added a Window to alter Orte of a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
5 * and comes with ABSOLUTELY NO WARRANTY! Check out
b8fd43021c29 Added a Window to alter Orte of a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
6 * the documentation coming with IMIS-Labordaten-Application for details.
b8fd43021c29 Added a Window to alter Orte of a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
7 */
b8fd43021c29 Added a Window to alter Orte of a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
8
b8fd43021c29 Added a Window to alter Orte of a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
9 /**
b8fd43021c29 Added a Window to alter Orte of a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
10 * Window to add a Ort to a Messprogramm
b8fd43021c29 Added a Window to alter Orte of a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
11 */
1288
08085b7d1d0b Ortszuordnung: Search, new orte, display and validity check
Maximilian Krambach <mkrambach@intevation.de>
parents: 1251
diff changeset
12 // TODO: This is >80% identical to Lada.view.form.Ortszuordnung.
08085b7d1d0b Ortszuordnung: Search, new orte, display and validity check
Maximilian Krambach <mkrambach@intevation.de>
parents: 1251
diff changeset
13 // Differences: This has no ortszuordnung record. It only receives and sends
08085b7d1d0b Ortszuordnung: Search, new orte, display and validity check
Maximilian Krambach <mkrambach@intevation.de>
parents: 1251
diff changeset
14 // an ortId
08085b7d1d0b Ortszuordnung: Search, new orte, display and validity check
Maximilian Krambach <mkrambach@intevation.de>
parents: 1251
diff changeset
15
797
b8fd43021c29 Added a Window to alter Orte of a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
16 Ext.define('Lada.view.window.MessprogrammOrt', {
b8fd43021c29 Added a Window to alter Orte of a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
17 extend: 'Ext.window.Window',
b8fd43021c29 Added a Window to alter Orte of a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
18 alias: 'widget.messprogrammort',
b8fd43021c29 Added a Window to alter Orte of a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
19
b8fd43021c29 Added a Window to alter Orte of a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
20 requires: [
1288
08085b7d1d0b Ortszuordnung: Search, new orte, display and validity check
Maximilian Krambach <mkrambach@intevation.de>
parents: 1251
diff changeset
21 'Lada.view.form.Ortserstellung',
797
b8fd43021c29 Added a Window to alter Orte of a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
22 'Lada.view.panel.Map',
1288
08085b7d1d0b Ortszuordnung: Search, new orte, display and validity check
Maximilian Krambach <mkrambach@intevation.de>
parents: 1251
diff changeset
23 'Lada.view.grid.Orte'
797
b8fd43021c29 Added a Window to alter Orte of a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
24 ],
b8fd43021c29 Added a Window to alter Orte of a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
25
b8fd43021c29 Added a Window to alter Orte of a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
26 collapsible: true,
b8fd43021c29 Added a Window to alter Orte of a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
27 maximizable: true,
b8fd43021c29 Added a Window to alter Orte of a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
28 autoshow: true,
1288
08085b7d1d0b Ortszuordnung: Search, new orte, display and validity check
Maximilian Krambach <mkrambach@intevation.de>
parents: 1251
diff changeset
29 layout: 'fit',
797
b8fd43021c29 Added a Window to alter Orte of a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
30 constrain: true,
b8fd43021c29 Added a Window to alter Orte of a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
31
b8fd43021c29 Added a Window to alter Orte of a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
32 parentWindow: null,
1288
08085b7d1d0b Ortszuordnung: Search, new orte, display and validity check
Maximilian Krambach <mkrambach@intevation.de>
parents: 1251
diff changeset
33
08085b7d1d0b Ortszuordnung: Search, new orte, display and validity check
Maximilian Krambach <mkrambach@intevation.de>
parents: 1251
diff changeset
34 ortId: null,
797
b8fd43021c29 Added a Window to alter Orte of a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
35
890
def27cdd0dfa Added Documentation to Windows
Dustin Demuth <dustin@intevation.de>
parents: 818
diff changeset
36 /**
def27cdd0dfa Added Documentation to Windows
Dustin Demuth <dustin@intevation.de>
parents: 818
diff changeset
37 * This function initialises the Window
def27cdd0dfa Added Documentation to Windows
Dustin Demuth <dustin@intevation.de>
parents: 818
diff changeset
38 */
797
b8fd43021c29 Added a Window to alter Orte of a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
39 initComponent: function() {
b8fd43021c29 Added a Window to alter Orte of a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
40 var i18n = Lada.getApplication().bundle;
b8fd43021c29 Added a Window to alter Orte of a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
41
b8fd43021c29 Added a Window to alter Orte of a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
42 this.title = i18n.getMsg('messprogrammort.window.title');
b8fd43021c29 Added a Window to alter Orte of a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
43 this.buttons = [{
b8fd43021c29 Added a Window to alter Orte of a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
44 text: i18n.getMsg('apply'),
b8fd43021c29 Added a Window to alter Orte of a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
45 scope: this,
b8fd43021c29 Added a Window to alter Orte of a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
46 handler: this.apply
b8fd43021c29 Added a Window to alter Orte of a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
47 }, {
b8fd43021c29 Added a Window to alter Orte of a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
48 text: i18n.getMsg('cancel'),
b8fd43021c29 Added a Window to alter Orte of a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
49 scope: this,
b8fd43021c29 Added a Window to alter Orte of a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
50 handler: function() {
818
097d4edc2f00 Genprobenwindow can only be created once, also fixed messprogrammortewindow 'close with x and can not reopen' bug
Dustin Demuth <dustin@intevation.de>
parents: 797
diff changeset
51 this.close();
797
b8fd43021c29 Added a Window to alter Orte of a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
52 this.parentWindow.down('messprogrammform')
b8fd43021c29 Added a Window to alter Orte of a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
53 .ortWindow = null;
b8fd43021c29 Added a Window to alter Orte of a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
54 }
b8fd43021c29 Added a Window to alter Orte of a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
55 }];
b8fd43021c29 Added a Window to alter Orte of a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
56
b8fd43021c29 Added a Window to alter Orte of a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
57 // add listeners to change the window appearence when it becomes inactive
b8fd43021c29 Added a Window to alter Orte of a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
58 this.on({
b8fd43021c29 Added a Window to alter Orte of a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
59 activate: function(){
b8fd43021c29 Added a Window to alter Orte of a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
60 this.getEl().removeCls('window-inactive');
b8fd43021c29 Added a Window to alter Orte of a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
61 },
b8fd43021c29 Added a Window to alter Orte of a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
62 deactivate: function(){
b8fd43021c29 Added a Window to alter Orte of a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
63 this.getEl().addCls('window-inactive');
818
097d4edc2f00 Genprobenwindow can only be created once, also fixed messprogrammortewindow 'close with x and can not reopen' bug
Dustin Demuth <dustin@intevation.de>
parents: 797
diff changeset
64 },
097d4edc2f00 Genprobenwindow can only be created once, also fixed messprogrammortewindow 'close with x and can not reopen' bug
Dustin Demuth <dustin@intevation.de>
parents: 797
diff changeset
65 close: function () {
097d4edc2f00 Genprobenwindow can only be created once, also fixed messprogrammortewindow 'close with x and can not reopen' bug
Dustin Demuth <dustin@intevation.de>
parents: 797
diff changeset
66 this.parentWindow.down('messprogrammform')
097d4edc2f00 Genprobenwindow can only be created once, also fixed messprogrammortewindow 'close with x and can not reopen' bug
Dustin Demuth <dustin@intevation.de>
parents: 797
diff changeset
67 .ortWindow = null;
797
b8fd43021c29 Added a Window to alter Orte of a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
68 }
b8fd43021c29 Added a Window to alter Orte of a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
69 });
b8fd43021c29 Added a Window to alter Orte of a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
70
b8fd43021c29 Added a Window to alter Orte of a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
71 this.items = [{
1288
08085b7d1d0b Ortszuordnung: Search, new orte, display and validity check
Maximilian Krambach <mkrambach@intevation.de>
parents: 1251
diff changeset
72 layout: 'border',
08085b7d1d0b Ortszuordnung: Search, new orte, display and validity check
Maximilian Krambach <mkrambach@intevation.de>
parents: 1251
diff changeset
73 bodyStyle: {background: '#fff'},
797
b8fd43021c29 Added a Window to alter Orte of a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
74 border: 0,
b8fd43021c29 Added a Window to alter Orte of a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
75 items: [{
b8fd43021c29 Added a Window to alter Orte of a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
76 xtype: 'map',
b8fd43021c29 Added a Window to alter Orte of a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
77 region: 'center',
b8fd43021c29 Added a Window to alter Orte of a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
78 layout: 'border',
1288
08085b7d1d0b Ortszuordnung: Search, new orte, display and validity check
Maximilian Krambach <mkrambach@intevation.de>
parents: 1251
diff changeset
79 margin: '13, 5, 10, 5',
08085b7d1d0b Ortszuordnung: Search, new orte, display and validity check
Maximilian Krambach <mkrambach@intevation.de>
parents: 1251
diff changeset
80 minHeight: 380,
08085b7d1d0b Ortszuordnung: Search, new orte, display and validity check
Maximilian Krambach <mkrambach@intevation.de>
parents: 1251
diff changeset
81 externalOrteStore: true
08085b7d1d0b Ortszuordnung: Search, new orte, display and validity check
Maximilian Krambach <mkrambach@intevation.de>
parents: 1251
diff changeset
82 }, {
08085b7d1d0b Ortszuordnung: Search, new orte, display and validity check
Maximilian Krambach <mkrambach@intevation.de>
parents: 1251
diff changeset
83 xtype: 'panel',
08085b7d1d0b Ortszuordnung: Search, new orte, display and validity check
Maximilian Krambach <mkrambach@intevation.de>
parents: 1251
diff changeset
84 layout: 'hbox',
08085b7d1d0b Ortszuordnung: Search, new orte, display and validity check
Maximilian Krambach <mkrambach@intevation.de>
parents: 1251
diff changeset
85 border: 0,
08085b7d1d0b Ortszuordnung: Search, new orte, display and validity check
Maximilian Krambach <mkrambach@intevation.de>
parents: 1251
diff changeset
86 margin: '0, 0, 10, 0',
08085b7d1d0b Ortszuordnung: Search, new orte, display and validity check
Maximilian Krambach <mkrambach@intevation.de>
parents: 1251
diff changeset
87 dockedItems: [{
08085b7d1d0b Ortszuordnung: Search, new orte, display and validity check
Maximilian Krambach <mkrambach@intevation.de>
parents: 1251
diff changeset
88 xtype: 'toolbar',
08085b7d1d0b Ortszuordnung: Search, new orte, display and validity check
Maximilian Krambach <mkrambach@intevation.de>
parents: 1251
diff changeset
89 dock: 'bottom',
08085b7d1d0b Ortszuordnung: Search, new orte, display and validity check
Maximilian Krambach <mkrambach@intevation.de>
parents: 1251
diff changeset
90 border: '0, 1, 1, 1',
08085b7d1d0b Ortszuordnung: Search, new orte, display and validity check
Maximilian Krambach <mkrambach@intevation.de>
parents: 1251
diff changeset
91 style: {
08085b7d1d0b Ortszuordnung: Search, new orte, display and validity check
Maximilian Krambach <mkrambach@intevation.de>
parents: 1251
diff changeset
92 borderBottom: '1px solid #b5b8c8 !important',
08085b7d1d0b Ortszuordnung: Search, new orte, display and validity check
Maximilian Krambach <mkrambach@intevation.de>
parents: 1251
diff changeset
93 borderLeft: '1px solid #b5b8c8 !important',
08085b7d1d0b Ortszuordnung: Search, new orte, display and validity check
Maximilian Krambach <mkrambach@intevation.de>
parents: 1251
diff changeset
94 borderRight: '1px solid #b5b8c8 !important'
08085b7d1d0b Ortszuordnung: Search, new orte, display and validity check
Maximilian Krambach <mkrambach@intevation.de>
parents: 1251
diff changeset
95 },
08085b7d1d0b Ortszuordnung: Search, new orte, display and validity check
Maximilian Krambach <mkrambach@intevation.de>
parents: 1251
diff changeset
96 items: [{
08085b7d1d0b Ortszuordnung: Search, new orte, display and validity check
Maximilian Krambach <mkrambach@intevation.de>
parents: 1251
diff changeset
97 text: i18n.getMsg('ortszuordnung.form.setOrt'),
08085b7d1d0b Ortszuordnung: Search, new orte, display and validity check
Maximilian Krambach <mkrambach@intevation.de>
parents: 1251
diff changeset
98 tooltip: i18n.getMsg('ortszuordnung.form.setOrt.qtip'),
08085b7d1d0b Ortszuordnung: Search, new orte, display and validity check
Maximilian Krambach <mkrambach@intevation.de>
parents: 1251
diff changeset
99 icon: 'resources/img/dialog-ok-apply.png',
08085b7d1d0b Ortszuordnung: Search, new orte, display and validity check
Maximilian Krambach <mkrambach@intevation.de>
parents: 1251
diff changeset
100 action: 'setOrt',
08085b7d1d0b Ortszuordnung: Search, new orte, display and validity check
Maximilian Krambach <mkrambach@intevation.de>
parents: 1251
diff changeset
101 enableToggle: true,
08085b7d1d0b Ortszuordnung: Search, new orte, display and validity check
Maximilian Krambach <mkrambach@intevation.de>
parents: 1251
diff changeset
102 disabled: true
08085b7d1d0b Ortszuordnung: Search, new orte, display and validity check
Maximilian Krambach <mkrambach@intevation.de>
parents: 1251
diff changeset
103 }, '->', {
08085b7d1d0b Ortszuordnung: Search, new orte, display and validity check
Maximilian Krambach <mkrambach@intevation.de>
parents: 1251
diff changeset
104 text: i18n.getMsg('save'),
08085b7d1d0b Ortszuordnung: Search, new orte, display and validity check
Maximilian Krambach <mkrambach@intevation.de>
parents: 1251
diff changeset
105 tooltip: i18n.getMsg('save.qtip'),
08085b7d1d0b Ortszuordnung: Search, new orte, display and validity check
Maximilian Krambach <mkrambach@intevation.de>
parents: 1251
diff changeset
106 icon: 'resources/img/dialog-ok-apply.png',
08085b7d1d0b Ortszuordnung: Search, new orte, display and validity check
Maximilian Krambach <mkrambach@intevation.de>
parents: 1251
diff changeset
107 action: 'save',
08085b7d1d0b Ortszuordnung: Search, new orte, display and validity check
Maximilian Krambach <mkrambach@intevation.de>
parents: 1251
diff changeset
108 disabled: true
08085b7d1d0b Ortszuordnung: Search, new orte, display and validity check
Maximilian Krambach <mkrambach@intevation.de>
parents: 1251
diff changeset
109 }, {
08085b7d1d0b Ortszuordnung: Search, new orte, display and validity check
Maximilian Krambach <mkrambach@intevation.de>
parents: 1251
diff changeset
110 text: i18n.getMsg('discard'),
08085b7d1d0b Ortszuordnung: Search, new orte, display and validity check
Maximilian Krambach <mkrambach@intevation.de>
parents: 1251
diff changeset
111 tooltip: i18n.getMsg('discard.qtip'),
08085b7d1d0b Ortszuordnung: Search, new orte, display and validity check
Maximilian Krambach <mkrambach@intevation.de>
parents: 1251
diff changeset
112 icon: 'resources/img/dialog-cancel.png',
08085b7d1d0b Ortszuordnung: Search, new orte, display and validity check
Maximilian Krambach <mkrambach@intevation.de>
parents: 1251
diff changeset
113 action: 'discard',
08085b7d1d0b Ortszuordnung: Search, new orte, display and validity check
Maximilian Krambach <mkrambach@intevation.de>
parents: 1251
diff changeset
114 disabled: true
08085b7d1d0b Ortszuordnung: Search, new orte, display and validity check
Maximilian Krambach <mkrambach@intevation.de>
parents: 1251
diff changeset
115 }]
08085b7d1d0b Ortszuordnung: Search, new orte, display and validity check
Maximilian Krambach <mkrambach@intevation.de>
parents: 1251
diff changeset
116 }],
08085b7d1d0b Ortszuordnung: Search, new orte, display and validity check
Maximilian Krambach <mkrambach@intevation.de>
parents: 1251
diff changeset
117 items: [Ext.create('Lada.view.form.OrtInfo')]
08085b7d1d0b Ortszuordnung: Search, new orte, display and validity check
Maximilian Krambach <mkrambach@intevation.de>
parents: 1251
diff changeset
118 }, {
08085b7d1d0b Ortszuordnung: Search, new orte, display and validity check
Maximilian Krambach <mkrambach@intevation.de>
parents: 1251
diff changeset
119 region: 'south',
08085b7d1d0b Ortszuordnung: Search, new orte, display and validity check
Maximilian Krambach <mkrambach@intevation.de>
parents: 1251
diff changeset
120 border: 0,
08085b7d1d0b Ortszuordnung: Search, new orte, display and validity check
Maximilian Krambach <mkrambach@intevation.de>
parents: 1251
diff changeset
121 layout: 'fit',
08085b7d1d0b Ortszuordnung: Search, new orte, display and validity check
Maximilian Krambach <mkrambach@intevation.de>
parents: 1251
diff changeset
122 name: 'ortgrid',
08085b7d1d0b Ortszuordnung: Search, new orte, display and validity check
Maximilian Krambach <mkrambach@intevation.de>
parents: 1251
diff changeset
123 hidden: true,
08085b7d1d0b Ortszuordnung: Search, new orte, display and validity check
Maximilian Krambach <mkrambach@intevation.de>
parents: 1251
diff changeset
124 maxHeight: 240,
08085b7d1d0b Ortszuordnung: Search, new orte, display and validity check
Maximilian Krambach <mkrambach@intevation.de>
parents: 1251
diff changeset
125 items: [{
08085b7d1d0b Ortszuordnung: Search, new orte, display and validity check
Maximilian Krambach <mkrambach@intevation.de>
parents: 1251
diff changeset
126 xtype: 'ortstammdatengrid'
08085b7d1d0b Ortszuordnung: Search, new orte, display and validity check
Maximilian Krambach <mkrambach@intevation.de>
parents: 1251
diff changeset
127 }],
08085b7d1d0b Ortszuordnung: Search, new orte, display and validity check
Maximilian Krambach <mkrambach@intevation.de>
parents: 1251
diff changeset
128 dockedItems: [{
08085b7d1d0b Ortszuordnung: Search, new orte, display and validity check
Maximilian Krambach <mkrambach@intevation.de>
parents: 1251
diff changeset
129 xtype: 'toolbar',
08085b7d1d0b Ortszuordnung: Search, new orte, display and validity check
Maximilian Krambach <mkrambach@intevation.de>
parents: 1251
diff changeset
130 dock: 'bottom',
08085b7d1d0b Ortszuordnung: Search, new orte, display and validity check
Maximilian Krambach <mkrambach@intevation.de>
parents: 1251
diff changeset
131 border: '0, 1, 1, 1',
08085b7d1d0b Ortszuordnung: Search, new orte, display and validity check
Maximilian Krambach <mkrambach@intevation.de>
parents: 1251
diff changeset
132 style: {
08085b7d1d0b Ortszuordnung: Search, new orte, display and validity check
Maximilian Krambach <mkrambach@intevation.de>
parents: 1251
diff changeset
133 borderBottom: '1px solid #b5b8c8 !important',
08085b7d1d0b Ortszuordnung: Search, new orte, display and validity check
Maximilian Krambach <mkrambach@intevation.de>
parents: 1251
diff changeset
134 borderLeft: '1px solid #b5b8c8 !important',
08085b7d1d0b Ortszuordnung: Search, new orte, display and validity check
Maximilian Krambach <mkrambach@intevation.de>
parents: 1251
diff changeset
135 borderRight: '1px solid #b5b8c8 !important'
08085b7d1d0b Ortszuordnung: Search, new orte, display and validity check
Maximilian Krambach <mkrambach@intevation.de>
parents: 1251
diff changeset
136 },
08085b7d1d0b Ortszuordnung: Search, new orte, display and validity check
Maximilian Krambach <mkrambach@intevation.de>
parents: 1251
diff changeset
137 items: [{
08085b7d1d0b Ortszuordnung: Search, new orte, display and validity check
Maximilian Krambach <mkrambach@intevation.de>
parents: 1251
diff changeset
138 xtype: 'textfield',
08085b7d1d0b Ortszuordnung: Search, new orte, display and validity check
Maximilian Krambach <mkrambach@intevation.de>
parents: 1251
diff changeset
139 name: 'search',
08085b7d1d0b Ortszuordnung: Search, new orte, display and validity check
Maximilian Krambach <mkrambach@intevation.de>
parents: 1251
diff changeset
140 labelWidth: 50,
08085b7d1d0b Ortszuordnung: Search, new orte, display and validity check
Maximilian Krambach <mkrambach@intevation.de>
parents: 1251
diff changeset
141 enableKeyEvents: true,
08085b7d1d0b Ortszuordnung: Search, new orte, display and validity check
Maximilian Krambach <mkrambach@intevation.de>
parents: 1251
diff changeset
142 fieldLabel: i18n.getMsg('ortszuordnung.ortsuche'),
08085b7d1d0b Ortszuordnung: Search, new orte, display and validity check
Maximilian Krambach <mkrambach@intevation.de>
parents: 1251
diff changeset
143 }, '->', {
08085b7d1d0b Ortszuordnung: Search, new orte, display and validity check
Maximilian Krambach <mkrambach@intevation.de>
parents: 1251
diff changeset
144 text: i18n.getMsg('orte.new'),
08085b7d1d0b Ortszuordnung: Search, new orte, display and validity check
Maximilian Krambach <mkrambach@intevation.de>
parents: 1251
diff changeset
145 action: 'createort'
08085b7d1d0b Ortszuordnung: Search, new orte, display and validity check
Maximilian Krambach <mkrambach@intevation.de>
parents: 1251
diff changeset
146 }, {
08085b7d1d0b Ortszuordnung: Search, new orte, display and validity check
Maximilian Krambach <mkrambach@intevation.de>
parents: 1251
diff changeset
147 text: i18n.getMsg('orte.frommap'),
08085b7d1d0b Ortszuordnung: Search, new orte, display and validity check
Maximilian Krambach <mkrambach@intevation.de>
parents: 1251
diff changeset
148 action: 'frommap'
08085b7d1d0b Ortszuordnung: Search, new orte, display and validity check
Maximilian Krambach <mkrambach@intevation.de>
parents: 1251
diff changeset
149 }, {
08085b7d1d0b Ortszuordnung: Search, new orte, display and validity check
Maximilian Krambach <mkrambach@intevation.de>
parents: 1251
diff changeset
150 text: i18n.getMsg('orte.clone'),
08085b7d1d0b Ortszuordnung: Search, new orte, display and validity check
Maximilian Krambach <mkrambach@intevation.de>
parents: 1251
diff changeset
151 action: 'clone'
08085b7d1d0b Ortszuordnung: Search, new orte, display and validity check
Maximilian Krambach <mkrambach@intevation.de>
parents: 1251
diff changeset
152 }]
08085b7d1d0b Ortszuordnung: Search, new orte, display and validity check
Maximilian Krambach <mkrambach@intevation.de>
parents: 1251
diff changeset
153 }]
797
b8fd43021c29 Added a Window to alter Orte of a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
154 }]
b8fd43021c29 Added a Window to alter Orte of a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
155 }];
b8fd43021c29 Added a Window to alter Orte of a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
156 this.callParent(arguments);
1288
08085b7d1d0b Ortszuordnung: Search, new orte, display and validity check
Maximilian Krambach <mkrambach@intevation.de>
parents: 1251
diff changeset
157 //TODO: load the passed OrtId
797
b8fd43021c29 Added a Window to alter Orte of a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
158 },
b8fd43021c29 Added a Window to alter Orte of a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
159
b8fd43021c29 Added a Window to alter Orte of a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
160 selectedFeature: function(context, args) {
b8fd43021c29 Added a Window to alter Orte of a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
161 var feature = args[0];
b8fd43021c29 Added a Window to alter Orte of a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
162 if (feature.attributes.id &&
b8fd43021c29 Added a Window to alter Orte of a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
163 feature.attributes.id !== '') {
1251
0a47e8af9006 Fixed orte window in messprogramm.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 890
diff changeset
164 var record = Ext.data.StoreManager.get('orte').getById(feature.attributes.id);
797
b8fd43021c29 Added a Window to alter Orte of a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
165 context.up('window').down('locationform').setRecord(record);
b8fd43021c29 Added a Window to alter Orte of a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
166 context.up('window').down('locationform').setReadOnly(true);
b8fd43021c29 Added a Window to alter Orte of a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
167 context.up('window').down('location').down('combobox').setValue(record.id);
b8fd43021c29 Added a Window to alter Orte of a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
168 }
b8fd43021c29 Added a Window to alter Orte of a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
169 else {
b8fd43021c29 Added a Window to alter Orte of a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
170 context.up('window').down('locationform').setRecord(this.locationRecord);
b8fd43021c29 Added a Window to alter Orte of a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
171 context.up('window').down('locationform').setReadOnly(false);
b8fd43021c29 Added a Window to alter Orte of a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
172 }
b8fd43021c29 Added a Window to alter Orte of a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
173 },
b8fd43021c29 Added a Window to alter Orte of a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
174
b8fd43021c29 Added a Window to alter Orte of a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
175 /**
b8fd43021c29 Added a Window to alter Orte of a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
176 * updateDetails is used when a value is selected within the location combobox
b8fd43021c29 Added a Window to alter Orte of a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
177 * When this function is called, the map element within the window
b8fd43021c29 Added a Window to alter Orte of a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
178 * which is embedding this form is updated.
b8fd43021c29 Added a Window to alter Orte of a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
179 *
b8fd43021c29 Added a Window to alter Orte of a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
180 * Mostly the same as in Lada.controlle.form.Ort
b8fd43021c29 Added a Window to alter Orte of a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
181 */
b8fd43021c29 Added a Window to alter Orte of a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
182 updateDetails: function(combobox, record) {
b8fd43021c29 Added a Window to alter Orte of a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
183 var win = combobox.up('window');
b8fd43021c29 Added a Window to alter Orte of a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
184 var details = win.down('locationform');
b8fd43021c29 Added a Window to alter Orte of a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
185 //var id = record[0].get('id'); // We are interested in the cbox...
b8fd43021c29 Added a Window to alter Orte of a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
186 var id = combobox.getValue();
b8fd43021c29 Added a Window to alter Orte of a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
187
b8fd43021c29 Added a Window to alter Orte of a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
188 if (details) {
1251
0a47e8af9006 Fixed orte window in messprogramm.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 890
diff changeset
189 var toLoad = Ext.data.StoreManager.get('orte').getById(id);
797
b8fd43021c29 Added a Window to alter Orte of a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
190 win.down('locationform').setRecord(toLoad);
1251
0a47e8af9006 Fixed orte window in messprogramm.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 890
diff changeset
191 win.down('map').selectFeature(id, toLoad);
797
b8fd43021c29 Added a Window to alter Orte of a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
192 }
b8fd43021c29 Added a Window to alter Orte of a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
193 },
b8fd43021c29 Added a Window to alter Orte of a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
194
b8fd43021c29 Added a Window to alter Orte of a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
195 /**
b8fd43021c29 Added a Window to alter Orte of a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
196 * Write the selected ortId into the record, and update the MessprogrammWindow.
b8fd43021c29 Added a Window to alter Orte of a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
197 */
b8fd43021c29 Added a Window to alter Orte of a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
198 apply: function(button) {
b8fd43021c29 Added a Window to alter Orte of a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
199 var win = button.up('window');
b8fd43021c29 Added a Window to alter Orte of a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
200 var ortId = win.down('location').down('combobox').value;
b8fd43021c29 Added a Window to alter Orte of a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
201 if (this.parentWindow) {
b8fd43021c29 Added a Window to alter Orte of a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
202 this.parentWindow.down('messprogrammform').down('location')
b8fd43021c29 Added a Window to alter Orte of a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
203 .down('combobox').setValue(ortId);
b8fd43021c29 Added a Window to alter Orte of a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
204 }
b8fd43021c29 Added a Window to alter Orte of a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
205
b8fd43021c29 Added a Window to alter Orte of a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
206 this.parentWindow.down('messprogrammform')
b8fd43021c29 Added a Window to alter Orte of a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
207 .ortWindow = null;
b8fd43021c29 Added a Window to alter Orte of a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
208 this.close();
b8fd43021c29 Added a Window to alter Orte of a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
209 },
890
def27cdd0dfa Added Documentation to Windows
Dustin Demuth <dustin@intevation.de>
parents: 818
diff changeset
210
def27cdd0dfa Added Documentation to Windows
Dustin Demuth <dustin@intevation.de>
parents: 818
diff changeset
211 /**
def27cdd0dfa Added Documentation to Windows
Dustin Demuth <dustin@intevation.de>
parents: 818
diff changeset
212 * Instructs the fields / forms listed in this method to set a message.
def27cdd0dfa Added Documentation to Windows
Dustin Demuth <dustin@intevation.de>
parents: 818
diff changeset
213 * @param errors These Errors shall be shown
def27cdd0dfa Added Documentation to Windows
Dustin Demuth <dustin@intevation.de>
parents: 818
diff changeset
214 * @param warnings These Warning shall be shown
def27cdd0dfa Added Documentation to Windows
Dustin Demuth <dustin@intevation.de>
parents: 818
diff changeset
215 */
797
b8fd43021c29 Added a Window to alter Orte of a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
216 setMessages: function(errors, warnings) {
b8fd43021c29 Added a Window to alter Orte of a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
217 //todo this is a stub
b8fd43021c29 Added a Window to alter Orte of a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
218 },
b8fd43021c29 Added a Window to alter Orte of a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
219
890
def27cdd0dfa Added Documentation to Windows
Dustin Demuth <dustin@intevation.de>
parents: 818
diff changeset
220 /**
def27cdd0dfa Added Documentation to Windows
Dustin Demuth <dustin@intevation.de>
parents: 818
diff changeset
221 * Instructs the fields / forms listed in this method to clear their messages.
def27cdd0dfa Added Documentation to Windows
Dustin Demuth <dustin@intevation.de>
parents: 818
diff changeset
222 */
797
b8fd43021c29 Added a Window to alter Orte of a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
223 clearMessages: function() {
b8fd43021c29 Added a Window to alter Orte of a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
224 //todo this is a stub
b8fd43021c29 Added a Window to alter Orte of a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
225 }
b8fd43021c29 Added a Window to alter Orte of a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
226 });
b8fd43021c29 Added a Window to alter Orte of a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
227

http://lada.wald.intevation.org