annotate app/view/window/MessprogrammOrt.js @ 1294:c1b7db04b39c

changed some form buttons to look like buttons
author Maximilian Krambach <mkrambach@intevation.de>
date Thu, 02 Feb 2017 10:34:53 +0100
parents 08085b7d1d0b
children
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',
1294
c1b7db04b39c changed some form buttons to look like buttons
Maximilian Krambach <mkrambach@intevation.de>
parents: 1288
diff changeset
90 ui: 'footer',
1288
08085b7d1d0b Ortszuordnung: Search, new orte, display and validity check
Maximilian Krambach <mkrambach@intevation.de>
parents: 1251
diff changeset
91 border: '0, 1, 1, 1',
08085b7d1d0b Ortszuordnung: Search, new orte, display and validity check
Maximilian Krambach <mkrambach@intevation.de>
parents: 1251
diff changeset
92 style: {
08085b7d1d0b Ortszuordnung: Search, new orte, display and validity check
Maximilian Krambach <mkrambach@intevation.de>
parents: 1251
diff changeset
93 borderBottom: '1px solid #b5b8c8 !important',
08085b7d1d0b Ortszuordnung: Search, new orte, display and validity check
Maximilian Krambach <mkrambach@intevation.de>
parents: 1251
diff changeset
94 borderLeft: '1px solid #b5b8c8 !important',
08085b7d1d0b Ortszuordnung: Search, new orte, display and validity check
Maximilian Krambach <mkrambach@intevation.de>
parents: 1251
diff changeset
95 borderRight: '1px solid #b5b8c8 !important'
08085b7d1d0b Ortszuordnung: Search, new orte, display and validity check
Maximilian Krambach <mkrambach@intevation.de>
parents: 1251
diff changeset
96 },
08085b7d1d0b Ortszuordnung: Search, new orte, display and validity check
Maximilian Krambach <mkrambach@intevation.de>
parents: 1251
diff changeset
97 items: [{
08085b7d1d0b Ortszuordnung: Search, new orte, display and validity check
Maximilian Krambach <mkrambach@intevation.de>
parents: 1251
diff changeset
98 text: i18n.getMsg('ortszuordnung.form.setOrt'),
08085b7d1d0b Ortszuordnung: Search, new orte, display and validity check
Maximilian Krambach <mkrambach@intevation.de>
parents: 1251
diff changeset
99 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
100 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
101 action: 'setOrt',
08085b7d1d0b Ortszuordnung: Search, new orte, display and validity check
Maximilian Krambach <mkrambach@intevation.de>
parents: 1251
diff changeset
102 enableToggle: true,
08085b7d1d0b Ortszuordnung: Search, new orte, display and validity check
Maximilian Krambach <mkrambach@intevation.de>
parents: 1251
diff changeset
103 disabled: true
08085b7d1d0b Ortszuordnung: Search, new orte, display and validity check
Maximilian Krambach <mkrambach@intevation.de>
parents: 1251
diff changeset
104 }, '->', {
08085b7d1d0b Ortszuordnung: Search, new orte, display and validity check
Maximilian Krambach <mkrambach@intevation.de>
parents: 1251
diff changeset
105 text: i18n.getMsg('save'),
08085b7d1d0b Ortszuordnung: Search, new orte, display and validity check
Maximilian Krambach <mkrambach@intevation.de>
parents: 1251
diff changeset
106 tooltip: i18n.getMsg('save.qtip'),
08085b7d1d0b Ortszuordnung: Search, new orte, display and validity check
Maximilian Krambach <mkrambach@intevation.de>
parents: 1251
diff changeset
107 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
108 action: 'save',
08085b7d1d0b Ortszuordnung: Search, new orte, display and validity check
Maximilian Krambach <mkrambach@intevation.de>
parents: 1251
diff changeset
109 disabled: true
08085b7d1d0b Ortszuordnung: Search, new orte, display and validity check
Maximilian Krambach <mkrambach@intevation.de>
parents: 1251
diff changeset
110 }, {
08085b7d1d0b Ortszuordnung: Search, new orte, display and validity check
Maximilian Krambach <mkrambach@intevation.de>
parents: 1251
diff changeset
111 text: i18n.getMsg('discard'),
08085b7d1d0b Ortszuordnung: Search, new orte, display and validity check
Maximilian Krambach <mkrambach@intevation.de>
parents: 1251
diff changeset
112 tooltip: i18n.getMsg('discard.qtip'),
08085b7d1d0b Ortszuordnung: Search, new orte, display and validity check
Maximilian Krambach <mkrambach@intevation.de>
parents: 1251
diff changeset
113 icon: 'resources/img/dialog-cancel.png',
08085b7d1d0b Ortszuordnung: Search, new orte, display and validity check
Maximilian Krambach <mkrambach@intevation.de>
parents: 1251
diff changeset
114 action: 'discard',
08085b7d1d0b Ortszuordnung: Search, new orte, display and validity check
Maximilian Krambach <mkrambach@intevation.de>
parents: 1251
diff changeset
115 disabled: true
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 }],
08085b7d1d0b Ortszuordnung: Search, new orte, display and validity check
Maximilian Krambach <mkrambach@intevation.de>
parents: 1251
diff changeset
118 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
119 }, {
08085b7d1d0b Ortszuordnung: Search, new orte, display and validity check
Maximilian Krambach <mkrambach@intevation.de>
parents: 1251
diff changeset
120 region: 'south',
08085b7d1d0b Ortszuordnung: Search, new orte, display and validity check
Maximilian Krambach <mkrambach@intevation.de>
parents: 1251
diff changeset
121 border: 0,
08085b7d1d0b Ortszuordnung: Search, new orte, display and validity check
Maximilian Krambach <mkrambach@intevation.de>
parents: 1251
diff changeset
122 layout: 'fit',
08085b7d1d0b Ortszuordnung: Search, new orte, display and validity check
Maximilian Krambach <mkrambach@intevation.de>
parents: 1251
diff changeset
123 name: 'ortgrid',
08085b7d1d0b Ortszuordnung: Search, new orte, display and validity check
Maximilian Krambach <mkrambach@intevation.de>
parents: 1251
diff changeset
124 hidden: true,
08085b7d1d0b Ortszuordnung: Search, new orte, display and validity check
Maximilian Krambach <mkrambach@intevation.de>
parents: 1251
diff changeset
125 maxHeight: 240,
08085b7d1d0b Ortszuordnung: Search, new orte, display and validity check
Maximilian Krambach <mkrambach@intevation.de>
parents: 1251
diff changeset
126 items: [{
08085b7d1d0b Ortszuordnung: Search, new orte, display and validity check
Maximilian Krambach <mkrambach@intevation.de>
parents: 1251
diff changeset
127 xtype: 'ortstammdatengrid'
08085b7d1d0b Ortszuordnung: Search, new orte, display and validity check
Maximilian Krambach <mkrambach@intevation.de>
parents: 1251
diff changeset
128 }],
08085b7d1d0b Ortszuordnung: Search, new orte, display and validity check
Maximilian Krambach <mkrambach@intevation.de>
parents: 1251
diff changeset
129 dockedItems: [{
08085b7d1d0b Ortszuordnung: Search, new orte, display and validity check
Maximilian Krambach <mkrambach@intevation.de>
parents: 1251
diff changeset
130 xtype: 'toolbar',
08085b7d1d0b Ortszuordnung: Search, new orte, display and validity check
Maximilian Krambach <mkrambach@intevation.de>
parents: 1251
diff changeset
131 dock: 'bottom',
08085b7d1d0b Ortszuordnung: Search, new orte, display and validity check
Maximilian Krambach <mkrambach@intevation.de>
parents: 1251
diff changeset
132 border: '0, 1, 1, 1',
08085b7d1d0b Ortszuordnung: Search, new orte, display and validity check
Maximilian Krambach <mkrambach@intevation.de>
parents: 1251
diff changeset
133 style: {
08085b7d1d0b Ortszuordnung: Search, new orte, display and validity check
Maximilian Krambach <mkrambach@intevation.de>
parents: 1251
diff changeset
134 borderBottom: '1px solid #b5b8c8 !important',
08085b7d1d0b Ortszuordnung: Search, new orte, display and validity check
Maximilian Krambach <mkrambach@intevation.de>
parents: 1251
diff changeset
135 borderLeft: '1px solid #b5b8c8 !important',
08085b7d1d0b Ortszuordnung: Search, new orte, display and validity check
Maximilian Krambach <mkrambach@intevation.de>
parents: 1251
diff changeset
136 borderRight: '1px solid #b5b8c8 !important'
08085b7d1d0b Ortszuordnung: Search, new orte, display and validity check
Maximilian Krambach <mkrambach@intevation.de>
parents: 1251
diff changeset
137 },
08085b7d1d0b Ortszuordnung: Search, new orte, display and validity check
Maximilian Krambach <mkrambach@intevation.de>
parents: 1251
diff changeset
138 items: [{
08085b7d1d0b Ortszuordnung: Search, new orte, display and validity check
Maximilian Krambach <mkrambach@intevation.de>
parents: 1251
diff changeset
139 xtype: 'textfield',
08085b7d1d0b Ortszuordnung: Search, new orte, display and validity check
Maximilian Krambach <mkrambach@intevation.de>
parents: 1251
diff changeset
140 name: 'search',
08085b7d1d0b Ortszuordnung: Search, new orte, display and validity check
Maximilian Krambach <mkrambach@intevation.de>
parents: 1251
diff changeset
141 labelWidth: 50,
08085b7d1d0b Ortszuordnung: Search, new orte, display and validity check
Maximilian Krambach <mkrambach@intevation.de>
parents: 1251
diff changeset
142 enableKeyEvents: true,
08085b7d1d0b Ortszuordnung: Search, new orte, display and validity check
Maximilian Krambach <mkrambach@intevation.de>
parents: 1251
diff changeset
143 fieldLabel: i18n.getMsg('ortszuordnung.ortsuche'),
08085b7d1d0b Ortszuordnung: Search, new orte, display and validity check
Maximilian Krambach <mkrambach@intevation.de>
parents: 1251
diff changeset
144 }, '->', {
08085b7d1d0b Ortszuordnung: Search, new orte, display and validity check
Maximilian Krambach <mkrambach@intevation.de>
parents: 1251
diff changeset
145 text: i18n.getMsg('orte.new'),
08085b7d1d0b Ortszuordnung: Search, new orte, display and validity check
Maximilian Krambach <mkrambach@intevation.de>
parents: 1251
diff changeset
146 action: 'createort'
08085b7d1d0b Ortszuordnung: Search, new orte, display and validity check
Maximilian Krambach <mkrambach@intevation.de>
parents: 1251
diff changeset
147 }, {
08085b7d1d0b Ortszuordnung: Search, new orte, display and validity check
Maximilian Krambach <mkrambach@intevation.de>
parents: 1251
diff changeset
148 text: i18n.getMsg('orte.frommap'),
08085b7d1d0b Ortszuordnung: Search, new orte, display and validity check
Maximilian Krambach <mkrambach@intevation.de>
parents: 1251
diff changeset
149 action: 'frommap'
08085b7d1d0b Ortszuordnung: Search, new orte, display and validity check
Maximilian Krambach <mkrambach@intevation.de>
parents: 1251
diff changeset
150 }, {
08085b7d1d0b Ortszuordnung: Search, new orte, display and validity check
Maximilian Krambach <mkrambach@intevation.de>
parents: 1251
diff changeset
151 text: i18n.getMsg('orte.clone'),
08085b7d1d0b Ortszuordnung: Search, new orte, display and validity check
Maximilian Krambach <mkrambach@intevation.de>
parents: 1251
diff changeset
152 action: 'clone'
08085b7d1d0b Ortszuordnung: Search, new orte, display and validity check
Maximilian Krambach <mkrambach@intevation.de>
parents: 1251
diff changeset
153 }]
08085b7d1d0b Ortszuordnung: Search, new orte, display and validity check
Maximilian Krambach <mkrambach@intevation.de>
parents: 1251
diff changeset
154 }]
797
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 }];
b8fd43021c29 Added a Window to alter Orte of a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
157 this.callParent(arguments);
1288
08085b7d1d0b Ortszuordnung: Search, new orte, display and validity check
Maximilian Krambach <mkrambach@intevation.de>
parents: 1251
diff changeset
158 //TODO: load the passed OrtId
797
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
b8fd43021c29 Added a Window to alter Orte of a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
161 selectedFeature: function(context, args) {
b8fd43021c29 Added a Window to alter Orte of a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
162 var feature = args[0];
b8fd43021c29 Added a Window to alter Orte of a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
163 if (feature.attributes.id &&
b8fd43021c29 Added a Window to alter Orte of a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
164 feature.attributes.id !== '') {
1251
0a47e8af9006 Fixed orte window in messprogramm.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 890
diff changeset
165 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
166 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
167 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
168 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
169 }
b8fd43021c29 Added a Window to alter Orte of a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
170 else {
b8fd43021c29 Added a Window to alter Orte of a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
171 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
172 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
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 /**
b8fd43021c29 Added a Window to alter Orte of a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
177 * 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
178 * 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
179 * 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
180 *
b8fd43021c29 Added a Window to alter Orte of a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
181 * 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
182 */
b8fd43021c29 Added a Window to alter Orte of a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
183 updateDetails: function(combobox, record) {
b8fd43021c29 Added a Window to alter Orte of a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
184 var win = combobox.up('window');
b8fd43021c29 Added a Window to alter Orte of a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
185 var details = win.down('locationform');
b8fd43021c29 Added a Window to alter Orte of a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
186 //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
187 var id = combobox.getValue();
b8fd43021c29 Added a Window to alter Orte of a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
188
b8fd43021c29 Added a Window to alter Orte of a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
189 if (details) {
1251
0a47e8af9006 Fixed orte window in messprogramm.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 890
diff changeset
190 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
191 win.down('locationform').setRecord(toLoad);
1251
0a47e8af9006 Fixed orte window in messprogramm.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 890
diff changeset
192 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
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 /**
b8fd43021c29 Added a Window to alter Orte of a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
197 * 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
198 */
b8fd43021c29 Added a Window to alter Orte of a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
199 apply: function(button) {
b8fd43021c29 Added a Window to alter Orte of a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
200 var win = button.up('window');
b8fd43021c29 Added a Window to alter Orte of a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
201 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
202 if (this.parentWindow) {
b8fd43021c29 Added a Window to alter Orte of a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
203 this.parentWindow.down('messprogrammform').down('location')
b8fd43021c29 Added a Window to alter Orte of a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
204 .down('combobox').setValue(ortId);
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
b8fd43021c29 Added a Window to alter Orte of a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
207 this.parentWindow.down('messprogrammform')
b8fd43021c29 Added a Window to alter Orte of a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
208 .ortWindow = null;
b8fd43021c29 Added a Window to alter Orte of a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
209 this.close();
b8fd43021c29 Added a Window to alter Orte of a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
210 },
890
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 /**
def27cdd0dfa Added Documentation to Windows
Dustin Demuth <dustin@intevation.de>
parents: 818
diff changeset
213 * 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
214 * @param errors These Errors shall be shown
def27cdd0dfa Added Documentation to Windows
Dustin Demuth <dustin@intevation.de>
parents: 818
diff changeset
215 * @param warnings These Warning shall be shown
def27cdd0dfa Added Documentation to Windows
Dustin Demuth <dustin@intevation.de>
parents: 818
diff changeset
216 */
797
b8fd43021c29 Added a Window to alter Orte of a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
217 setMessages: function(errors, warnings) {
b8fd43021c29 Added a Window to alter Orte of a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
218 //todo this is a stub
b8fd43021c29 Added a Window to alter Orte of a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
219 },
b8fd43021c29 Added a Window to alter Orte of a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
220
890
def27cdd0dfa Added Documentation to Windows
Dustin Demuth <dustin@intevation.de>
parents: 818
diff changeset
221 /**
def27cdd0dfa Added Documentation to Windows
Dustin Demuth <dustin@intevation.de>
parents: 818
diff changeset
222 * 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
223 */
797
b8fd43021c29 Added a Window to alter Orte of a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
224 clearMessages: function() {
b8fd43021c29 Added a Window to alter Orte of a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
225 //todo this is a stub
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 });
b8fd43021c29 Added a Window to alter Orte of a Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
228

http://lada.wald.intevation.org