Mercurial > lada > lada-client
annotate app/view/window/Ortszuordnung.js @ 1013:75ce503ab296 stammdatengrids
Added a Ortszuordnungwindow and Form
author | Dustin Demuth <dustin@intevation.de> |
---|---|
date | Tue, 26 Jan 2016 12:29:59 +0100 |
parents | |
children | 1df6b6210b42 |
rev | line source |
---|---|
1013
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
1 /* Copyright (C) 2013 by Bundesamt fuer Strahlenschutz |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
2 * Software engineering by Intevation GmbH |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
3 * |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
4 * This file is Free Software under the GNU GPL (v>=3) |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
5 * and comes with ABSOLUTELY NO WARRANTY! Check out |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
6 * the documentation coming with IMIS-Labordaten-Application for details. |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
7 */ |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
8 |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
9 /** |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
10 * Window to create/edit the Ort / Probe Relation |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
11 */ |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
12 Ext.define('Lada.view.window.Ortszuordnung', { |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
13 extend: 'Ext.window.Window', |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
14 alias: 'widget.ortszuordnungwindow', |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
15 |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
16 requires: [ |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
17 'Lada.view.form.Ortszuordnung' |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
18 ], |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
19 |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
20 collapsible: true, |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
21 maximizable: true, |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
22 autoshow: true, |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
23 layout: 'border', |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
24 constrain: true, |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
25 |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
26 probe: null, |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
27 parentWindow: null, |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
28 record: null, |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
29 grid: null, |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
30 |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
31 /** |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
32 * This function initialises the Window |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
33 */ |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
34 initComponent: function() { |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
35 var i18n = Lada.getApplication().bundle; |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
36 |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
37 this.title = i18n.getMsg('ortszuordnung.window.title'); |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
38 |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
39 if (this.record && this.probe) { |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
40 // A new record will be created |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
41 this.title = i18n.getMsg('ortszuordnung.window.title') |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
42 + ' ' |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
43 + i18n.getMsg('ortszuordnung.window.title2') |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
44 + ' ' |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
45 + i18n.getMsg('probe') |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
46 + ' ' |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
47 + probe.get('hauptprobennr') |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
48 + ' ' |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
49 + i18n.getMsg('edit'); |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
50 } |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
51 else if (this.probe) { |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
52 // A new record will be created |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
53 this.title = i18n.getMsg('ortszuordnung.window.title') |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
54 + ' ' |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
55 + i18n.getMsg('ortszuordnung.window.title2') |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
56 + ' ' |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
57 + i18n.getMsg('probe') |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
58 + ' ' |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
59 + probe.get('hauptprobennr') |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
60 + ' ' |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
61 + i18n.getMsg('create'); |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
62 } |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
63 |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
64 this.buttons = [{ |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
65 text: i18n.getMsg('close'), |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
66 scope: this, |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
67 handler: this.close |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
68 }]; |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
69 this.width = 900; |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
70 this.height = 515; |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
71 this.bodyStyle = {background: '#fff'}; |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
72 |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
73 // add listeners to change the window appearence when it becomes inactive |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
74 this.on({ |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
75 activate: function(){ |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
76 this.getEl().removeCls('window-inactive'); |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
77 }, |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
78 deactivate: function(){ |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
79 this.getEl().addCls('window-inactive'); |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
80 } |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
81 }); |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
82 |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
83 this.items = [{ |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
84 region: 'west', |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
85 border: 0, |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
86 layout: 'hbox', |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
87 items: [{ |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
88 xtype: 'ortszuordnungform', |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
89 margin: 5 |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
90 //}, { |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
91 // xtype: 'ortpanel', |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
92 // margin: 5 |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
93 }] |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
94 }]; |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
95 this.callParent(arguments); |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
96 }, |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
97 |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
98 /** |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
99 * Initialise the Data of this Window |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
100 */ |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
101 initData: function() { |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
102 this.down('ortszuordnungform').setRecord(this.record); |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
103 }, |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
104 |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
105 /** |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
106 * Instructs the fields / forms listed in this method to set a message. |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
107 * @param errors These Errors shall be shown |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
108 * @param warnings These Warning shall be shown |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
109 */ |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
110 setMessages: function(errors, warnings) { |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
111 //todo this is a stub |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
112 }, |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
113 |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
114 /** |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
115 * Instructs the fields / forms listed in this method to clear their messages. |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
116 */ |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
117 clearMessages: function() { |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
118 //todo this is a stub |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
119 } |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
120 }); |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
121 |