Mercurial > lada > lada-client
comparison 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 |
comparison
equal
deleted
inserted
replaced
1012:2adc329d90fe | 1013:75ce503ab296 |
---|---|
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 ], | |
19 | |
20 collapsible: true, | |
21 maximizable: true, | |
22 autoshow: true, | |
23 layout: 'border', | |
24 constrain: true, | |
25 | |
26 probe: null, | |
27 parentWindow: null, | |
28 record: null, | |
29 grid: null, | |
30 | |
31 /** | |
32 * This function initialises the Window | |
33 */ | |
34 initComponent: function() { | |
35 var i18n = Lada.getApplication().bundle; | |
36 | |
37 this.title = i18n.getMsg('ortszuordnung.window.title'); | |
38 | |
39 if (this.record && this.probe) { | |
40 // A new record will be created | |
41 this.title = i18n.getMsg('ortszuordnung.window.title') | |
42 + ' ' | |
43 + i18n.getMsg('ortszuordnung.window.title2') | |
44 + ' ' | |
45 + i18n.getMsg('probe') | |
46 + ' ' | |
47 + probe.get('hauptprobennr') | |
48 + ' ' | |
49 + i18n.getMsg('edit'); | |
50 } | |
51 else if (this.probe) { | |
52 // A new record will be created | |
53 this.title = i18n.getMsg('ortszuordnung.window.title') | |
54 + ' ' | |
55 + i18n.getMsg('ortszuordnung.window.title2') | |
56 + ' ' | |
57 + i18n.getMsg('probe') | |
58 + ' ' | |
59 + probe.get('hauptprobennr') | |
60 + ' ' | |
61 + i18n.getMsg('create'); | |
62 } | |
63 | |
64 this.buttons = [{ | |
65 text: i18n.getMsg('close'), | |
66 scope: this, | |
67 handler: this.close | |
68 }]; | |
69 this.width = 900; | |
70 this.height = 515; | |
71 this.bodyStyle = {background: '#fff'}; | |
72 | |
73 // add listeners to change the window appearence when it becomes inactive | |
74 this.on({ | |
75 activate: function(){ | |
76 this.getEl().removeCls('window-inactive'); | |
77 }, | |
78 deactivate: function(){ | |
79 this.getEl().addCls('window-inactive'); | |
80 } | |
81 }); | |
82 | |
83 this.items = [{ | |
84 region: 'west', | |
85 border: 0, | |
86 layout: 'hbox', | |
87 items: [{ | |
88 xtype: 'ortszuordnungform', | |
89 margin: 5 | |
90 //}, { | |
91 // xtype: 'ortpanel', | |
92 // margin: 5 | |
93 }] | |
94 }]; | |
95 this.callParent(arguments); | |
96 }, | |
97 | |
98 /** | |
99 * Initialise the Data of this Window | |
100 */ | |
101 initData: function() { | |
102 this.down('ortszuordnungform').setRecord(this.record); | |
103 }, | |
104 | |
105 /** | |
106 * Instructs the fields / forms listed in this method to set a message. | |
107 * @param errors These Errors shall be shown | |
108 * @param warnings These Warning shall be shown | |
109 */ | |
110 setMessages: function(errors, warnings) { | |
111 //todo this is a stub | |
112 }, | |
113 | |
114 /** | |
115 * Instructs the fields / forms listed in this method to clear their messages. | |
116 */ | |
117 clearMessages: function() { | |
118 //todo this is a stub | |
119 } | |
120 }); | |
121 |