Mercurial > lada > lada-client
comparison app/view/window/Ortszuordnung.js @ 1021:1df6b6210b42 stammdatengrids
WIP First Version of a New Window/Panel combination to edit Ortszuordnungen and Orte
author | Dustin Demuth <dustin@intevation.de> |
---|---|
date | Thu, 04 Feb 2016 16:31:46 +0100 |
parents | 75ce503ab296 |
children | 1bd4c0709bd6 |
comparison
equal
deleted
inserted
replaced
1014:e9e974d31924 | 1021:1df6b6210b42 |
---|---|
12 Ext.define('Lada.view.window.Ortszuordnung', { | 12 Ext.define('Lada.view.window.Ortszuordnung', { |
13 extend: 'Ext.window.Window', | 13 extend: 'Ext.window.Window', |
14 alias: 'widget.ortszuordnungwindow', | 14 alias: 'widget.ortszuordnungwindow', |
15 | 15 |
16 requires: [ | 16 requires: [ |
17 'Lada.view.form.Ortszuordnung' | 17 'Lada.view.form.Ortszuordnung', |
18 'Lada.view.panel.Ort' | |
18 ], | 19 ], |
19 | 20 |
20 collapsible: true, | 21 collapsible: true, |
21 maximizable: true, | 22 maximizable: true, |
22 autoshow: true, | 23 autoshow: true, |
23 layout: 'border', | 24 layout: 'vbox', |
24 constrain: true, | 25 constrain: true, |
25 | 26 |
26 probe: null, | 27 probe: null, |
27 parentWindow: null, | 28 parentWindow: null, |
28 record: null, | 29 record: null, |
35 var i18n = Lada.getApplication().bundle; | 36 var i18n = Lada.getApplication().bundle; |
36 | 37 |
37 this.title = i18n.getMsg('ortszuordnung.window.title'); | 38 this.title = i18n.getMsg('ortszuordnung.window.title'); |
38 | 39 |
39 if (this.record && this.probe) { | 40 if (this.record && this.probe) { |
40 // A new record will be created | 41 // A record be edited |
41 this.title = i18n.getMsg('ortszuordnung.window.title') | 42 this.title = i18n.getMsg('ortszuordnung.window.title') |
42 + ' ' | 43 + ' ' |
43 + i18n.getMsg('ortszuordnung.window.title2') | 44 + i18n.getMsg('ortszuordnung.window.title2') |
44 + ' ' | 45 + ' ' |
45 + i18n.getMsg('probe') | 46 + i18n.getMsg('probe') |
46 + ' ' | 47 + ' ' |
47 + probe.get('hauptprobennr') | 48 + this.probe.get('hauptprobennr') |
48 + ' ' | 49 + ' ' |
49 + i18n.getMsg('edit'); | 50 + i18n.getMsg('edit'); |
50 } | 51 } |
51 else if (this.probe) { | 52 else if (this.probe) { |
52 // A new record will be created | 53 // A new record will be created |
54 + ' ' | 55 + ' ' |
55 + i18n.getMsg('ortszuordnung.window.title2') | 56 + i18n.getMsg('ortszuordnung.window.title2') |
56 + ' ' | 57 + ' ' |
57 + i18n.getMsg('probe') | 58 + i18n.getMsg('probe') |
58 + ' ' | 59 + ' ' |
59 + probe.get('hauptprobennr') | 60 + this.probe.get('hauptprobennr') |
60 + ' ' | 61 + ' ' |
61 + i18n.getMsg('create'); | 62 + i18n.getMsg('create'); |
62 } | 63 } |
63 | 64 |
64 this.buttons = [{ | 65 this.buttons = [{ |
79 this.getEl().addCls('window-inactive'); | 80 this.getEl().addCls('window-inactive'); |
80 } | 81 } |
81 }); | 82 }); |
82 | 83 |
83 this.items = [{ | 84 this.items = [{ |
84 region: 'west', | 85 xtype: 'ortszuordnungform', |
85 border: 0, | 86 layout: 'fit', |
86 layout: 'hbox', | 87 margin: 5 |
87 items: [{ | 88 }, { |
88 xtype: 'ortszuordnungform', | 89 xtype: 'ortpanel', |
89 margin: 5 | 90 flex: 1, |
90 //}, { | 91 toolbarPos: 'bottom', |
91 // xtype: 'ortpanel', | 92 margin: 5 |
92 // margin: 5 | |
93 }] | |
94 }]; | 93 }]; |
95 this.callParent(arguments); | 94 this.callParent(arguments); |
96 }, | 95 }, |
97 | 96 |
98 /** | 97 /** |
99 * Initialise the Data of this Window | 98 * Initialise the Data of this Window |
100 */ | 99 */ |
101 initData: function() { | 100 initData: function() { |
102 this.down('ortszuordnungform').setRecord(this.record); | 101 this.down('ortszuordnungform').setRecord(this.record); |
102 this.down('ortpanel').setStore(); | |
103 }, | |
104 | |
105 /** | |
106 * @private | |
107 * Override to display and update the map view in the panel. | |
108 */ | |
109 afterRender: function(){ | |
110 this.superclass.afterRender.apply(this, arguments); | |
111 var map = this.down('ortpanel').down('map'); | |
112 map.map.zoomToMaxExtent(); | |
103 }, | 113 }, |
104 | 114 |
105 /** | 115 /** |
106 * Instructs the fields / forms listed in this method to set a message. | 116 * Instructs the fields / forms listed in this method to set a message. |
107 * @param errors These Errors shall be shown | 117 * @param errors These Errors shall be shown |