Mercurial > lada > lada-client
annotate app/view/grid/MessprogrammKategorie.js @ 1020:00da72171de3
No default value for statuswerte, this time it should work
author | Dustin Demuth <dustin@intevation.de> |
---|---|
date | Thu, 04 Feb 2016 16:17:26 +0100 |
parents | 15d8c64049d1 |
children | 6afdbc8ee920 77e22ad5cc84 |
rev | line source |
---|---|
975
fb99332bb48e
Severe changes concerning the Resultgrids.
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
1 /* Copyright (C) 2013 by Bundesamt fuer Strahlenschutz |
fb99332bb48e
Severe changes concerning the Resultgrids.
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
2 * Software engineering by Intevation GmbH |
fb99332bb48e
Severe changes concerning the Resultgrids.
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
3 * |
fb99332bb48e
Severe changes concerning the Resultgrids.
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
4 * This file is Free Software under the GNU GPL (v>=3) |
fb99332bb48e
Severe changes concerning the Resultgrids.
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
5 * and comes with ABSOLUTELY NO WARRANTY! Check out |
fb99332bb48e
Severe changes concerning the Resultgrids.
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
6 * the documentation coming with IMIS-Labordaten-Application for details. |
fb99332bb48e
Severe changes concerning the Resultgrids.
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
7 */ |
fb99332bb48e
Severe changes concerning the Resultgrids.
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
8 |
fb99332bb48e
Severe changes concerning the Resultgrids.
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
9 /** |
fb99332bb48e
Severe changes concerning the Resultgrids.
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
10 * Grid to list MessprogrammKategorie Stammdaten |
fb99332bb48e
Severe changes concerning the Resultgrids.
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
11 */ |
fb99332bb48e
Severe changes concerning the Resultgrids.
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
12 Ext.define('Lada.view.grid.MessprogrammKategorie', { |
fb99332bb48e
Severe changes concerning the Resultgrids.
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
13 extend: 'Ext.grid.Panel', |
fb99332bb48e
Severe changes concerning the Resultgrids.
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
14 alias: 'widget.mkgrid', |
fb99332bb48e
Severe changes concerning the Resultgrids.
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
15 |
fb99332bb48e
Severe changes concerning the Resultgrids.
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
16 // minHeight and deferEmptyText are needed to be able to show the |
fb99332bb48e
Severe changes concerning the Resultgrids.
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
17 // emptyText message. |
fb99332bb48e
Severe changes concerning the Resultgrids.
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
18 minHeight: 110, |
fb99332bb48e
Severe changes concerning the Resultgrids.
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
19 viewConfig: { |
fb99332bb48e
Severe changes concerning the Resultgrids.
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
20 deferEmptyText: false |
fb99332bb48e
Severe changes concerning the Resultgrids.
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
21 }, |
fb99332bb48e
Severe changes concerning the Resultgrids.
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
22 |
fb99332bb48e
Severe changes concerning the Resultgrids.
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
23 warnings: null, |
fb99332bb48e
Severe changes concerning the Resultgrids.
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
24 errors: null, |
fb99332bb48e
Severe changes concerning the Resultgrids.
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
25 readOnly: true, |
fb99332bb48e
Severe changes concerning the Resultgrids.
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
26 allowDeselect: true, |
981
2c394e72ba41
Use the lada-server for stammdatenqueries.
Dustin Demuth <dustin@intevation.de>
parents:
975
diff
changeset
|
27 border: false, |
975
fb99332bb48e
Severe changes concerning the Resultgrids.
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
28 |
fb99332bb48e
Severe changes concerning the Resultgrids.
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
29 initComponent: function() { |
fb99332bb48e
Severe changes concerning the Resultgrids.
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
30 var i18n = Lada.getApplication().bundle; |
fb99332bb48e
Severe changes concerning the Resultgrids.
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
31 this.emptyText = i18n.getMsg('mk.emptyGrid'); |
fb99332bb48e
Severe changes concerning the Resultgrids.
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
32 |
982
d8b0b23047b1
Added GridEditor Plugin
Dustin Demuth <dustin@intevation.de>
parents:
981
diff
changeset
|
33 this.rowEditing = Ext.create('Ext.grid.plugin.RowEditing', { |
d8b0b23047b1
Added GridEditor Plugin
Dustin Demuth <dustin@intevation.de>
parents:
981
diff
changeset
|
34 clicksToMoveEditor: 1, |
d8b0b23047b1
Added GridEditor Plugin
Dustin Demuth <dustin@intevation.de>
parents:
981
diff
changeset
|
35 autoCancel: false, |
d8b0b23047b1
Added GridEditor Plugin
Dustin Demuth <dustin@intevation.de>
parents:
981
diff
changeset
|
36 disabled: false, |
d8b0b23047b1
Added GridEditor Plugin
Dustin Demuth <dustin@intevation.de>
parents:
981
diff
changeset
|
37 pluginId: 'rowedit' |
d8b0b23047b1
Added GridEditor Plugin
Dustin Demuth <dustin@intevation.de>
parents:
981
diff
changeset
|
38 }); |
d8b0b23047b1
Added GridEditor Plugin
Dustin Demuth <dustin@intevation.de>
parents:
981
diff
changeset
|
39 this.plugins = [this.rowEditing]; |
d8b0b23047b1
Added GridEditor Plugin
Dustin Demuth <dustin@intevation.de>
parents:
981
diff
changeset
|
40 |
975
fb99332bb48e
Severe changes concerning the Resultgrids.
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
41 // TODO: Which docked Items are required? |
fb99332bb48e
Severe changes concerning the Resultgrids.
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
42 this.dockedItems = [{ |
fb99332bb48e
Severe changes concerning the Resultgrids.
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
43 xtype: 'toolbar', |
fb99332bb48e
Severe changes concerning the Resultgrids.
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
44 dock: 'top', |
fb99332bb48e
Severe changes concerning the Resultgrids.
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
45 items: [{ |
fb99332bb48e
Severe changes concerning the Resultgrids.
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
46 xtype: 'tbtext', |
fb99332bb48e
Severe changes concerning the Resultgrids.
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
47 id: 'tbtitle', |
fb99332bb48e
Severe changes concerning the Resultgrids.
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
48 text: i18n.getMsg('mk.gridTitle') |
1003
15d8c64049d1
Datensatzerzeuger now uses the server. Added i18n to confirmation messages
Dustin Demuth <dustin@intevation.de>
parents:
982
diff
changeset
|
49 }, |
15d8c64049d1
Datensatzerzeuger now uses the server. Added i18n to confirmation messages
Dustin Demuth <dustin@intevation.de>
parents:
982
diff
changeset
|
50 '->', |
15d8c64049d1
Datensatzerzeuger now uses the server. Added i18n to confirmation messages
Dustin Demuth <dustin@intevation.de>
parents:
982
diff
changeset
|
51 { |
15d8c64049d1
Datensatzerzeuger now uses the server. Added i18n to confirmation messages
Dustin Demuth <dustin@intevation.de>
parents:
982
diff
changeset
|
52 text: i18n.getMsg('mk.button.add'), |
15d8c64049d1
Datensatzerzeuger now uses the server. Added i18n to confirmation messages
Dustin Demuth <dustin@intevation.de>
parents:
982
diff
changeset
|
53 icon: 'resources/img/list-add.png', |
15d8c64049d1
Datensatzerzeuger now uses the server. Added i18n to confirmation messages
Dustin Demuth <dustin@intevation.de>
parents:
982
diff
changeset
|
54 action: 'add', |
15d8c64049d1
Datensatzerzeuger now uses the server. Added i18n to confirmation messages
Dustin Demuth <dustin@intevation.de>
parents:
982
diff
changeset
|
55 disabled: true // disabled on startup, will be enabled by setStore |
15d8c64049d1
Datensatzerzeuger now uses the server. Added i18n to confirmation messages
Dustin Demuth <dustin@intevation.de>
parents:
982
diff
changeset
|
56 }, { |
15d8c64049d1
Datensatzerzeuger now uses the server. Added i18n to confirmation messages
Dustin Demuth <dustin@intevation.de>
parents:
982
diff
changeset
|
57 text: i18n.getMsg('mk.button.delete'), |
15d8c64049d1
Datensatzerzeuger now uses the server. Added i18n to confirmation messages
Dustin Demuth <dustin@intevation.de>
parents:
982
diff
changeset
|
58 icon: 'resources/img/list-remove.png', |
15d8c64049d1
Datensatzerzeuger now uses the server. Added i18n to confirmation messages
Dustin Demuth <dustin@intevation.de>
parents:
982
diff
changeset
|
59 action: 'delete', |
15d8c64049d1
Datensatzerzeuger now uses the server. Added i18n to confirmation messages
Dustin Demuth <dustin@intevation.de>
parents:
982
diff
changeset
|
60 disabled: true // disabled on startup, will be enabled by controller if necessary |
975
fb99332bb48e
Severe changes concerning the Resultgrids.
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
61 }] |
fb99332bb48e
Severe changes concerning the Resultgrids.
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
62 }]; |
fb99332bb48e
Severe changes concerning the Resultgrids.
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
63 |
fb99332bb48e
Severe changes concerning the Resultgrids.
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
64 this.columns = [{ |
fb99332bb48e
Severe changes concerning the Resultgrids.
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
65 header: i18n.getMsg('netzbetreiberId'), |
fb99332bb48e
Severe changes concerning the Resultgrids.
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
66 dataIndex: 'netzbetreiberId', |
fb99332bb48e
Severe changes concerning the Resultgrids.
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
67 renderer: function(value) { |
fb99332bb48e
Severe changes concerning the Resultgrids.
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
68 var r = ''; |
fb99332bb48e
Severe changes concerning the Resultgrids.
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
69 if (!value || value === '') { |
fb99332bb48e
Severe changes concerning the Resultgrids.
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
70 r = 'Error'; |
fb99332bb48e
Severe changes concerning the Resultgrids.
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
71 } |
fb99332bb48e
Severe changes concerning the Resultgrids.
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
72 var store = Ext.data.StoreManager.get('netzbetreiber'); |
fb99332bb48e
Severe changes concerning the Resultgrids.
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
73 var record = store.getById(value); |
fb99332bb48e
Severe changes concerning the Resultgrids.
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
74 if (record) { |
fb99332bb48e
Severe changes concerning the Resultgrids.
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
75 r = record.get('netzbetreiber'); |
fb99332bb48e
Severe changes concerning the Resultgrids.
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
76 } |
fb99332bb48e
Severe changes concerning the Resultgrids.
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
77 return r; |
fb99332bb48e
Severe changes concerning the Resultgrids.
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
78 }, |
fb99332bb48e
Severe changes concerning the Resultgrids.
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
79 editor: { |
fb99332bb48e
Severe changes concerning the Resultgrids.
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
80 xtype: 'combobox', |
fb99332bb48e
Severe changes concerning the Resultgrids.
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
81 store: Ext.data.StoreManager.get('netzbetreiber'), |
fb99332bb48e
Severe changes concerning the Resultgrids.
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
82 displayField: 'netzbetreiber', |
fb99332bb48e
Severe changes concerning the Resultgrids.
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
83 valueField: 'id', |
fb99332bb48e
Severe changes concerning the Resultgrids.
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
84 allowBlank: false |
fb99332bb48e
Severe changes concerning the Resultgrids.
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
85 } |
fb99332bb48e
Severe changes concerning the Resultgrids.
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
86 }, { |
fb99332bb48e
Severe changes concerning the Resultgrids.
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
87 header: i18n.getMsg('mplId'), |
fb99332bb48e
Severe changes concerning the Resultgrids.
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
88 dataIndex: 'mplId', |
fb99332bb48e
Severe changes concerning the Resultgrids.
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
89 editor: { |
fb99332bb48e
Severe changes concerning the Resultgrids.
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
90 allowBlank: false |
fb99332bb48e
Severe changes concerning the Resultgrids.
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
91 } |
fb99332bb48e
Severe changes concerning the Resultgrids.
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
92 }, { |
fb99332bb48e
Severe changes concerning the Resultgrids.
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
93 header: i18n.getMsg('bezeichnung'), |
fb99332bb48e
Severe changes concerning the Resultgrids.
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
94 dataIndex: 'bezeichnung', |
fb99332bb48e
Severe changes concerning the Resultgrids.
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
95 editor: { |
fb99332bb48e
Severe changes concerning the Resultgrids.
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
96 allowBlank: false |
fb99332bb48e
Severe changes concerning the Resultgrids.
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
97 } |
fb99332bb48e
Severe changes concerning the Resultgrids.
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
98 }, { |
fb99332bb48e
Severe changes concerning the Resultgrids.
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
99 header: i18n.getMsg('letzteAenderung'), |
fb99332bb48e
Severe changes concerning the Resultgrids.
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
100 dataIndex: 'letzteAenderung' |
fb99332bb48e
Severe changes concerning the Resultgrids.
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
101 }]; |
fb99332bb48e
Severe changes concerning the Resultgrids.
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
102 this.listeners = { |
fb99332bb48e
Severe changes concerning the Resultgrids.
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
103 select: { |
fb99332bb48e
Severe changes concerning the Resultgrids.
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
104 fn: this.activateRemoveButton, |
fb99332bb48e
Severe changes concerning the Resultgrids.
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
105 scope: this |
fb99332bb48e
Severe changes concerning the Resultgrids.
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
106 }, |
fb99332bb48e
Severe changes concerning the Resultgrids.
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
107 deselect: { |
fb99332bb48e
Severe changes concerning the Resultgrids.
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
108 fn: this.deactivateRemoveButton, |
fb99332bb48e
Severe changes concerning the Resultgrids.
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
109 scope: this |
fb99332bb48e
Severe changes concerning the Resultgrids.
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
110 } |
fb99332bb48e
Severe changes concerning the Resultgrids.
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
111 }; |
fb99332bb48e
Severe changes concerning the Resultgrids.
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
112 this.callParent(arguments); |
fb99332bb48e
Severe changes concerning the Resultgrids.
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
113 }, |
fb99332bb48e
Severe changes concerning the Resultgrids.
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
114 |
fb99332bb48e
Severe changes concerning the Resultgrids.
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
115 /** |
fb99332bb48e
Severe changes concerning the Resultgrids.
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
116 * This sets the Store of this Grid |
fb99332bb48e
Severe changes concerning the Resultgrids.
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
117 */ |
fb99332bb48e
Severe changes concerning the Resultgrids.
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
118 setStore: function(store){ |
fb99332bb48e
Severe changes concerning the Resultgrids.
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
119 var i18n = Lada.getApplication().bundle; |
fb99332bb48e
Severe changes concerning the Resultgrids.
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
120 |
fb99332bb48e
Severe changes concerning the Resultgrids.
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
121 this.removeDocked(Ext.getCmp('ptbar'), true); |
fb99332bb48e
Severe changes concerning the Resultgrids.
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
122 this.reconfigure(store); |
fb99332bb48e
Severe changes concerning the Resultgrids.
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
123 this.addDocked([{ |
fb99332bb48e
Severe changes concerning the Resultgrids.
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
124 xtype: 'pagingtoolbar', |
fb99332bb48e
Severe changes concerning the Resultgrids.
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
125 id: 'ptbar', |
fb99332bb48e
Severe changes concerning the Resultgrids.
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
126 dock: 'bottom', |
fb99332bb48e
Severe changes concerning the Resultgrids.
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
127 store: store, |
fb99332bb48e
Severe changes concerning the Resultgrids.
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
128 displayInfo: true |
fb99332bb48e
Severe changes concerning the Resultgrids.
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
129 }]); |
fb99332bb48e
Severe changes concerning the Resultgrids.
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
130 } |
fb99332bb48e
Severe changes concerning the Resultgrids.
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
131 }); |