comparison app/view/grid/MessprogrammKategorie.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 MessprogrammKategorie Stammdaten
11 */
12 Ext.define('Lada.view.grid.MessprogrammKategorie', {
13 extend: 'Ext.grid.Panel',
14 alias: 'widget.mkgrid',
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('mk.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('mk.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('mplId'),
67 dataIndex: 'mplId',
68 editor: {
69 allowBlank: false
70 }
71 }, {
72 header: i18n.getMsg('bezeichnung'),
73 dataIndex: 'bezeichnung',
74 editor: {
75 allowBlank: false
76 }
77 }, {
78 header: i18n.getMsg('letzteAenderung'),
79 dataIndex: 'letzteAenderung'
80 }];
81 this.listeners = {
82 select: {
83 fn: this.activateRemoveButton,
84 scope: this
85 },
86 deselect: {
87 fn: this.deactivateRemoveButton,
88 scope: this
89 }
90 };
91 this.callParent(arguments);
92 },
93
94 /**
95 * This sets the Store of this Grid
96 */
97 setStore: function(store){
98 var i18n = Lada.getApplication().bundle;
99
100 this.removeDocked(Ext.getCmp('ptbar'), true);
101 this.reconfigure(store);
102 this.addDocked([{
103 xtype: 'pagingtoolbar',
104 id: 'ptbar',
105 dock: 'bottom',
106 store: store,
107 displayInfo: true
108 }]);
109 }
110 });

http://lada.wald.intevation.org