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