comparison app/view/grid/Orte.js @ 1004:9ac03f461ab4 stammdatengrids

Introduced Orte into Stammdatengrids, Added Ortszuordnung. THIS COMMIT IS WORK IN PROGRESS, Proben will NOT work after this commit. Orte can not be edited.
author Dustin Demuth <dustin@intevation.de>
date Wed, 20 Jan 2016 12:32:42 +0100
parents
children 6afdbc8ee920
comparison
equal deleted inserted replaced
1003:15d8c64049d1 1004:9ac03f461ab4
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 * Grid to list Orte Stammdaten
11 */
12 Ext.define('Lada.view.grid.Orte', {
13 extend: 'Ext.grid.Panel',
14 alias: 'widget.ortstammdatengrid',
15
16 // minHeight and deferEmptyText are needed to be able to show the
17 // emptyText message.
18 minHeight: 110,
19 viewConfig: {
20 deferEmptyText: false
21 },
22
23 recordId: null,
24
25 warnings: null,
26 errors: null,
27 readOnly: true,
28 allowDeselect: true,
29
30 initComponent: function() {
31 var i18n = Lada.getApplication().bundle;
32 this.emptyText = i18n.getMsg('orte.emptyGrid');
33
34 this.dockedItems = [{
35 xtype: 'toolbar',
36 dock: 'top',
37 items: [{
38 xtype: 'tbtext',
39 id: 'tbtitle',
40 text: i18n.getMsg('orte.gridTitle')
41 },
42 '->',
43 {
44 text: i18n.getMsg('orte.button.add'),
45 icon: 'resources/img/list-add.png',
46 action: 'add',
47 disabled: true // disabled on startup, will be enabled by setStore
48 }, {
49 text: i18n.getMsg('orte.button.delete'),
50 icon: 'resources/img/list-remove.png',
51 action: 'delete',
52 disabled: true // disabled on startup, will be enabled by controller if necessary
53 }]
54 }];
55 this.columns = [{
56 header: i18n.getMsg('orte.ortId'),
57 dataIndex: 'ortId'
58 }, {
59 header: i18n.getMsg('orte.nutsCode'),
60 dataIndex: 'nutsCode'
61 }, {
62 header: i18n.getMsg('orte.anlageId'),
63 dataIndex: 'anlageId'
64 }, {
65 header: i18n.getMsg('orte.gemId'),
66 dataIndex: 'gemId',
67 width: 120,
68 renderer: function(value) {
69 var store = Ext.data.StoreManager.get('verwaltungseinheiten');
70 var record = store.getById(value);
71 return record.get('bezeichnung');
72 }
73 }, {
74 header: i18n.getMsg('orte.staatId'),
75 dataIndex: 'staatId',
76 width: 70,
77 renderer: function(value) {
78 var staaten = Ext.data.StoreManager.get('staaten');
79 var record = staaten.getById(value);
80 return record.get('staatIso');
81 }
82 }, {
83 header: i18n.getMsg('orte.kdaId'),
84 dataIndex: 'kdaId'
85 }, {
86 header: i18n.getMsg('orte.ozId'),
87 dataIndex: 'ozId'
88 }, {
89 header: i18n.getMsg('orte.ortTyp'),
90 dataIndex: 'ortTyp'
91 }, {
92 header: i18n.getMsg('orte.mpArt'),
93 dataIndex: 'mpArt'
94 }, {
95 header: i18n.getMsg('orte.zone'),
96 dataIndex: 'zone'
97 }, {
98 header: i18n.getMsg('orte.sektor'),
99 dataIndex: 'sektor'
100 }, {
101 header: i18n.getMsg('orte.zustaendigkeit'),
102 dataIndex: 'zustaendigkeit'
103 }, {
104 header: i18n.getMsg('orte.berichtstext'),
105 dataIndex: 'berichtstext'
106 }, {
107 header: i18n.getMsg('orte.kurztext'),
108 dataIndex: 'kurztext'
109 }, {
110 header: i18n.getMsg('orte.langtext'),
111 dataIndex: 'langtext'
112 }, {
113 header: i18n.getMsg('orte.beschreibung'),
114 dataIndex: 'beschreibung'
115 }, {
116 header: i18n.getMsg('orte.unscharf'),
117 dataIndex: 'unscharf'
118 }, {
119 header: i18n.getMsg('orte.hoeheLand'),
120 dataIndex: 'hoeheLand'
121 }, {
122 header: i18n.getMsg('orte.koordXExtern'),
123 dataIndex: 'koordXExtern'
124 }, {
125 header: i18n.getMsg('orte.koordYExtern'),
126 dataIndex: 'koordYExtern'
127 }, {
128 header: i18n.getMsg('orte.longitude'),
129 dataIndex: 'longitude'
130 }, {
131 header: i18n.getMsg('orte.latitude'),
132 dataIndex: 'latitude'
133 }, {
134 header: i18n.getMsg('orte.letzteAenderung'),
135 dataIndex: 'letzteAenderung'
136 }];
137 this.listeners = {
138 select: {
139 fn: this.activateRemoveButton,
140 scope: this
141 },
142 deselect: {
143 fn: this.deactivateRemoveButton,
144 scope: this
145 }
146 };
147 this.listeners = {
148 select: {
149 fn: this.activateRemoveButton,
150 scope: this
151 },
152 deselect: {
153 fn: this.deactivateRemoveButton,
154 scope: this
155 }
156 };
157 this.callParent(arguments);
158 },
159
160 /**
161 * This sets the Store of this Grid
162 */
163 setStore: function(store){
164 var i18n = Lada.getApplication().bundle;
165
166 if (store) {
167 this.removeDocked(Ext.getCmp('ptbar'), true);
168 this.reconfigure(store);
169 this.down('button[action=add]').enable();
170 this.addDocked([{
171 xtype: 'pagingtoolbar',
172 id: 'ptbar',
173 dock: 'bottom',
174 store: store,
175 displayInfo: true
176 }]);
177 }
178 }
179 });

http://lada.wald.intevation.org