comparison app/view/grid/DatensatzErzeuger.js @ 975:fb99332bb48e stammdatengrids

Severe changes concerning the Resultgrids. - Intrduced "Stammdaten" which can be selected in the Mode Field on the left side, - Added Stores and Models for the Stammdaten - Removed the FilterResultgrid and replaced it with a model which uses inheritance. Dynamic Grid Columns can now be derived from app/view/widget/DynamicGrid.js For Proben and Messprogramme this is already done. - There might be some REGRESSION concerning the buttons in the ProbeList and MessprogrammeList grid, as those are not disabled properly. This needs to be fixed in future commits.
author Dustin Demuth <dustin@intevation.de>
date Wed, 02 Dec 2015 17:39:04 +0100
parents
children 2c394e72ba41
comparison
equal deleted inserted replaced
974:ea477f62a667 975:fb99332bb48e
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 DatensatzErzeuger Stammdaten
11 */
12 Ext.define('Lada.view.grid.DatensatzErzeuger', {
13 extend: 'Ext.grid.Panel',
14 alias: 'widget.datensatzerzeugergrid',
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 warnings: null,
24 errors: null,
25 readOnly: true,
26 allowDeselect: true,
27
28 initComponent: function() {
29 var i18n = Lada.getApplication().bundle;
30 this.emptyText = i18n.getMsg('de.emptyGrid');
31
32 // TODO: Which docked Items are required?
33 this.dockedItems = [{
34 xtype: 'toolbar',
35 dock: 'top',
36 items: [{
37 xtype: 'tbtext',
38 id: 'tbtitle',
39 text: i18n.getMsg('de.gridTitle')
40 }]
41 }];
42
43 this.columns = [{
44 header: i18n.getMsg('netzbetreiberId'),
45 dataIndex: 'netzbetreiberId',
46 renderer: function(value) {
47 var r = '';
48 if (!value || value === '') {
49 r = 'Error';
50 }
51 var store = Ext.data.StoreManager.get('netzbetreiber');
52 var record = store.getById(value);
53 if (record) {
54 r = record.get('netzbetreiber');
55 }
56 return r;
57 },
58 editor: {
59 xtype: 'combobox',
60 store: Ext.data.StoreManager.get('netzbetreiber'),
61 displayField: 'netzbetreiber',
62 valueField: 'id',
63 allowBlank: false
64 }
65 }, {
66 header: i18n.getMsg('daErzeugerId'),
67 dataIndex: 'daErzeugerId',
68 editor: {
69 allowBlank: false
70 }
71 }, {
72 header: i18n.getMsg('mstId'),
73 dataIndex: 'mstId',
74 renderer: function(value) {
75 var r = '';
76 if (!value || value === '') {
77 r = 'Error';
78 }
79 var store = Ext.data.StoreManager.get('messstellen');
80 var record = store.getById(value);
81 if (record) {
82 r = record.get('messStelle');
83 }
84 return r;
85 },
86 editor: {
87 xtype: 'combobox',
88 store: Ext.data.StoreManager.get('messstellenFiltered'),
89 displayField: 'messStelle',
90 valueField: 'id',
91 allowBlank: false
92 }
93 }, {
94 header: i18n.getMsg('letzteAenderung'),
95 dataIndex: 'letzteAenderung'
96 }];
97 this.listeners = {
98 select: {
99 fn: this.activateRemoveButton,
100 scope: this
101 },
102 deselect: {
103 fn: this.deactivateRemoveButton,
104 scope: this
105 }
106 };
107 this.callParent(arguments);
108 },
109
110 /**
111 * This sets the Store of this Grid
112 */
113 setStore: function(store){
114 var i18n = Lada.getApplication().bundle;
115
116 this.removeDocked(Ext.getCmp('ptbar'), true);
117 this.reconfigure(store);
118 this.addDocked([{
119 xtype: 'pagingtoolbar',
120 id: 'ptbar',
121 dock: 'bottom',
122 store: store,
123 displayInfo: true
124 }]);
125 }
126 });

http://lada.wald.intevation.org