annotate app/view/grid/Status.js @ 961:6f1cc3316e2d

Intermediate Result. When creating a Messung a Statuswert will be set.
author Dustin Demuth <dustin@intevation.de>
date Tue, 10 Nov 2015 13:07:57 +0100
parents 5d57c6c53e20
children 6a6f2c6fe8ee
rev   line source
594
89b337cbfb5d Added status grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
1 /* Copyright (C) 2013 by Bundesamt fuer Strahlenschutz
89b337cbfb5d Added status grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
2 * Software engineering by Intevation GmbH
89b337cbfb5d Added status grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
3 *
89b337cbfb5d Added status grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
4 * This file is Free Software under the GNU GPL (v>=3)
89b337cbfb5d Added status grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
5 * and comes with ABSOLUTELY NO WARRANTY! Check out
89b337cbfb5d Added status grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
6 * the documentation coming with IMIS-Labordaten-Application for details.
89b337cbfb5d Added status grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
7 */
89b337cbfb5d Added status grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
8
893
07dfcdf5b41f jsduck for grids and panels
Dustin Demuth <dustin@intevation.de>
parents: 824
diff changeset
9 /**
594
89b337cbfb5d Added status grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
10 * Grid to list Status
89b337cbfb5d Added status grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
11 */
89b337cbfb5d Added status grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
12 Ext.define('Lada.view.grid.Status', {
89b337cbfb5d Added status grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
13 extend: 'Ext.grid.Panel',
89b337cbfb5d Added status grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
14 alias: 'widget.statusgrid',
89b337cbfb5d Added status grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
15
89b337cbfb5d Added status grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
16 maxHeight: 350,
89b337cbfb5d Added status grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
17 emptyText: 'Keine Statusangaben gefunden.',
89b337cbfb5d Added status grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
18 minHeight: 110,
89b337cbfb5d Added status grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
19 viewConfig: {
89b337cbfb5d Added status grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
20 deferEmptyText: false
89b337cbfb5d Added status grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
21 },
89b337cbfb5d Added status grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
22
89b337cbfb5d Added status grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
23 recordId: null,
824
fab0b7be5aca add disbled remove button to all grids which relate to proben or messungen. Messprogramme-grids are untouched. BUG: When the last entry is deleted, the button remains active
Dustin Demuth <dustin@intevation.de>
parents: 799
diff changeset
24 readOnly: true,
fab0b7be5aca add disbled remove button to all grids which relate to proben or messungen. Messprogramme-grids are untouched. BUG: When the last entry is deleted, the button remains active
Dustin Demuth <dustin@intevation.de>
parents: 799
diff changeset
25 allowDeselect: true,
594
89b337cbfb5d Added status grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
26
89b337cbfb5d Added status grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
27 initComponent: function() {
89b337cbfb5d Added status grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
28 this.rowEditing = Ext.create('Ext.grid.plugin.RowEditing', {
89b337cbfb5d Added status grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
29 clicksToMoveEditor: 1,
683
612f4f933083 Made Grid-Rows uneditable if the dataset contains readonly=true. This only affects the Grids using the RowEdit Plugin
Dustin Demuth <dustin@intevation.de>
parents: 663
diff changeset
30 autoCancel: false,
945
023e622f9551 Added the ability to work with "StatusWerten" which are delivered by the lada-server.
Dustin Demuth <dustin@intevation.de>
parents: 944
diff changeset
31 disabled: true,
684
69cb367c0a63 When a Probeform is dirty, all child-grids are made readonly (Row Editing is not disbled correctly). When a Probe is read-only all Child-grid buttons are disabled. When a Probe is ReadOnly probeform is also readonly.
Dustin Demuth <dustin@intevation.de>
parents: 683
diff changeset
32 pluginId: 'rowedit',
683
612f4f933083 Made Grid-Rows uneditable if the dataset contains readonly=true. This only affects the Grids using the RowEdit Plugin
Dustin Demuth <dustin@intevation.de>
parents: 663
diff changeset
33 listeners:{
612f4f933083 Made Grid-Rows uneditable if the dataset contains readonly=true. This only affects the Grids using the RowEdit Plugin
Dustin Demuth <dustin@intevation.de>
parents: 663
diff changeset
34 // Make row ineditable when readonly is set to true
612f4f933083 Made Grid-Rows uneditable if the dataset contains readonly=true. This only affects the Grids using the RowEdit Plugin
Dustin Demuth <dustin@intevation.de>
parents: 663
diff changeset
35 // Normally this would belong into a controller an not the view.
703
9ab7b1eed9f8 Rowediting is now disabled when the Grid was set to ReadOnly
Dustin Demuth <dustin@intevation.de>
parents: 684
diff changeset
36 // But the RowEditPlugin is not handled there.
683
612f4f933083 Made Grid-Rows uneditable if the dataset contains readonly=true. This only affects the Grids using the RowEdit Plugin
Dustin Demuth <dustin@intevation.de>
parents: 663
diff changeset
37 beforeedit: function(e, o) {
945
023e622f9551 Added the ability to work with "StatusWerten" which are delivered by the lada-server.
Dustin Demuth <dustin@intevation.de>
parents: 944
diff changeset
38 var readonlywin = o.grid.up('window').record.get('readonly');
703
9ab7b1eed9f8 Rowediting is now disabled when the Grid was set to ReadOnly
Dustin Demuth <dustin@intevation.de>
parents: 684
diff changeset
39 var readonlygrid = o.record.get('readonly');
9ab7b1eed9f8 Rowediting is now disabled when the Grid was set to ReadOnly
Dustin Demuth <dustin@intevation.de>
parents: 684
diff changeset
40 if (readonlywin == true || readonlygrid == true || this.disabled) {
683
612f4f933083 Made Grid-Rows uneditable if the dataset contains readonly=true. This only affects the Grids using the RowEdit Plugin
Dustin Demuth <dustin@intevation.de>
parents: 663
diff changeset
41 return false;
612f4f933083 Made Grid-Rows uneditable if the dataset contains readonly=true. This only affects the Grids using the RowEdit Plugin
Dustin Demuth <dustin@intevation.de>
parents: 663
diff changeset
42 }
612f4f933083 Made Grid-Rows uneditable if the dataset contains readonly=true. This only affects the Grids using the RowEdit Plugin
Dustin Demuth <dustin@intevation.de>
parents: 663
diff changeset
43 return true;
612f4f933083 Made Grid-Rows uneditable if the dataset contains readonly=true. This only affects the Grids using the RowEdit Plugin
Dustin Demuth <dustin@intevation.de>
parents: 663
diff changeset
44 }
612f4f933083 Made Grid-Rows uneditable if the dataset contains readonly=true. This only affects the Grids using the RowEdit Plugin
Dustin Demuth <dustin@intevation.de>
parents: 663
diff changeset
45 }
945
023e622f9551 Added the ability to work with "StatusWerten" which are delivered by the lada-server.
Dustin Demuth <dustin@intevation.de>
parents: 944
diff changeset
46 });
594
89b337cbfb5d Added status grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
47 this.plugins = [this.rowEditing];
89b337cbfb5d Added status grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
48
956
45c67a784b31 Added StatusStufe to the StatusGrid. Created Store and Model for StatusStufe
Dustin Demuth <dustin@intevation.de>
parents: 950
diff changeset
49 var statusWerteStore = Ext.create('Lada.store.StatusWerte');
961
6f1cc3316e2d Intermediate Result. When creating a Messung a Statuswert will be set.
Dustin Demuth <dustin@intevation.de>
parents: 958
diff changeset
50 statusWerteStore.load({
6f1cc3316e2d Intermediate Result. When creating a Messung a Statuswert will be set.
Dustin Demuth <dustin@intevation.de>
parents: 958
diff changeset
51 //params: {
6f1cc3316e2d Intermediate Result. When creating a Messung a Statuswert will be set.
Dustin Demuth <dustin@intevation.de>
parents: 958
diff changeset
52 // messungsId: this.recordId
6f1cc3316e2d Intermediate Result. When creating a Messung a Statuswert will be set.
Dustin Demuth <dustin@intevation.de>
parents: 958
diff changeset
53 //}
6f1cc3316e2d Intermediate Result. When creating a Messung a Statuswert will be set.
Dustin Demuth <dustin@intevation.de>
parents: 958
diff changeset
54 });
956
45c67a784b31 Added StatusStufe to the StatusGrid. Created Store and Model for StatusStufe
Dustin Demuth <dustin@intevation.de>
parents: 950
diff changeset
55 var statusStufeStore = Ext.create('Lada.store.StatusStufe');
961
6f1cc3316e2d Intermediate Result. When creating a Messung a Statuswert will be set.
Dustin Demuth <dustin@intevation.de>
parents: 958
diff changeset
56 statusStufeStore.load({
6f1cc3316e2d Intermediate Result. When creating a Messung a Statuswert will be set.
Dustin Demuth <dustin@intevation.de>
parents: 958
diff changeset
57 //params: {
6f1cc3316e2d Intermediate Result. When creating a Messung a Statuswert will be set.
Dustin Demuth <dustin@intevation.de>
parents: 958
diff changeset
58 // messungsId: this.recordId
6f1cc3316e2d Intermediate Result. When creating a Messung a Statuswert will be set.
Dustin Demuth <dustin@intevation.de>
parents: 958
diff changeset
59 //}
6f1cc3316e2d Intermediate Result. When creating a Messung a Statuswert will be set.
Dustin Demuth <dustin@intevation.de>
parents: 958
diff changeset
60 });
594
89b337cbfb5d Added status grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
61 this.dockedItems = [{
89b337cbfb5d Added status grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
62 xtype: 'toolbar',
89b337cbfb5d Added status grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
63 dock: 'bottom',
89b337cbfb5d Added status grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
64 items: ['->', {
89b337cbfb5d Added status grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
65 text: 'Hinzufügen',
89b337cbfb5d Added status grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
66 icon: 'resources/img/list-add.png',
89b337cbfb5d Added status grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
67 action: 'add',
89b337cbfb5d Added status grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
68 probeId: this.probeId,
89b337cbfb5d Added status grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
69 parentId: this.parentId
89b337cbfb5d Added status grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
70 }, {
89b337cbfb5d Added status grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
71 text: 'Löschen',
89b337cbfb5d Added status grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
72 icon: 'resources/img/list-remove.png',
89b337cbfb5d Added status grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
73 action: 'delete'
89b337cbfb5d Added status grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
74 }]
89b337cbfb5d Added status grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
75 }];
89b337cbfb5d Added status grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
76 this.columns = [{
944
1f1467713c3f Status grid modified
Michael Stanko <mstanko@bfs.de>
parents: 893
diff changeset
77 header: 'erstellt',
945
023e622f9551 Added the ability to work with "StatusWerten" which are delivered by the lada-server.
Dustin Demuth <dustin@intevation.de>
parents: 944
diff changeset
78 dataIndex: 'datum',
944
1f1467713c3f Status grid modified
Michael Stanko <mstanko@bfs.de>
parents: 893
diff changeset
79 xtype: 'datecolumn',
1f1467713c3f Status grid modified
Michael Stanko <mstanko@bfs.de>
parents: 893
diff changeset
80 format: 'd.m.Y H:i',
1f1467713c3f Status grid modified
Michael Stanko <mstanko@bfs.de>
parents: 893
diff changeset
81 width: 110,
945
023e622f9551 Added the ability to work with "StatusWerten" which are delivered by the lada-server.
Dustin Demuth <dustin@intevation.de>
parents: 944
diff changeset
82 sortable: false,
944
1f1467713c3f Status grid modified
Michael Stanko <mstanko@bfs.de>
parents: 893
diff changeset
83 }, {
594
89b337cbfb5d Added status grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
84 header: 'Erzeuger',
89b337cbfb5d Added status grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
85 dataIndex: 'erzeuger',
89b337cbfb5d Added status grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
86 renderer: function(value) {
961
6f1cc3316e2d Intermediate Result. When creating a Messung a Statuswert will be set.
Dustin Demuth <dustin@intevation.de>
parents: 958
diff changeset
87 var r = '';
594
89b337cbfb5d Added status grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
88 if (!value || value === '') {
961
6f1cc3316e2d Intermediate Result. When creating a Messung a Statuswert will be set.
Dustin Demuth <dustin@intevation.de>
parents: 958
diff changeset
89 r = 'Error';
594
89b337cbfb5d Added status grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
90 }
89b337cbfb5d Added status grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
91 var mstore = Ext.data.StoreManager.get('messstellen');
961
6f1cc3316e2d Intermediate Result. When creating a Messung a Statuswert will be set.
Dustin Demuth <dustin@intevation.de>
parents: 958
diff changeset
92 var item = mstore.getById(value);
6f1cc3316e2d Intermediate Result. When creating a Messung a Statuswert will be set.
Dustin Demuth <dustin@intevation.de>
parents: 958
diff changeset
93 if (item) {
6f1cc3316e2d Intermediate Result. When creating a Messung a Statuswert will be set.
Dustin Demuth <dustin@intevation.de>
parents: 958
diff changeset
94 r = item.get('messStelle');
6f1cc3316e2d Intermediate Result. When creating a Messung a Statuswert will be set.
Dustin Demuth <dustin@intevation.de>
parents: 958
diff changeset
95 }
6f1cc3316e2d Intermediate Result. When creating a Messung a Statuswert will be set.
Dustin Demuth <dustin@intevation.de>
parents: 958
diff changeset
96 return r;
594
89b337cbfb5d Added status grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
97 },
89b337cbfb5d Added status grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
98 editor: {
89b337cbfb5d Added status grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
99 xtype: 'combobox',
89b337cbfb5d Added status grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
100 store: Ext.data.StoreManager.get('messstellen'),
89b337cbfb5d Added status grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
101 displayField: 'messStelle',
89b337cbfb5d Added status grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
102 valueField: 'id',
663
1c5a4b419149 Field Validity in Status Grid
Dustin Demuth <dustin@intevation.de>
parents: 630
diff changeset
103 allowBlank: false,
1c5a4b419149 Field Validity in Status Grid
Dustin Demuth <dustin@intevation.de>
parents: 630
diff changeset
104 editable: false
945
023e622f9551 Added the ability to work with "StatusWerten" which are delivered by the lada-server.
Dustin Demuth <dustin@intevation.de>
parents: 944
diff changeset
105 },
023e622f9551 Added the ability to work with "StatusWerten" which are delivered by the lada-server.
Dustin Demuth <dustin@intevation.de>
parents: 944
diff changeset
106 sortable: false,
594
89b337cbfb5d Added status grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
107 }, {
956
45c67a784b31 Added StatusStufe to the StatusGrid. Created Store and Model for StatusStufe
Dustin Demuth <dustin@intevation.de>
parents: 950
diff changeset
108 header: 'Stufe',
45c67a784b31 Added StatusStufe to the StatusGrid. Created Store and Model for StatusStufe
Dustin Demuth <dustin@intevation.de>
parents: 950
diff changeset
109 dataIndex: 'statusStufe',
45c67a784b31 Added StatusStufe to the StatusGrid. Created Store and Model for StatusStufe
Dustin Demuth <dustin@intevation.de>
parents: 950
diff changeset
110 renderer: function(value) {
958
5d57c6c53e20 Made the grids more robust against erroneous data
Dustin Demuth <dustin@intevation.de>
parents: 957
diff changeset
111 var r;
957
881984972e0e Added Statusstufe to MessungForm
Dustin Demuth <dustin@intevation.de>
parents: 956
diff changeset
112 if (value===null || value === '') {
958
5d57c6c53e20 Made the grids more robust against erroneous data
Dustin Demuth <dustin@intevation.de>
parents: 957
diff changeset
113 r = 'Error';
956
45c67a784b31 Added StatusStufe to the StatusGrid. Created Store and Model for StatusStufe
Dustin Demuth <dustin@intevation.de>
parents: 950
diff changeset
114 }
957
881984972e0e Added Statusstufe to MessungForm
Dustin Demuth <dustin@intevation.de>
parents: 956
diff changeset
115 var item = statusStufeStore.getById(value);
881984972e0e Added Statusstufe to MessungForm
Dustin Demuth <dustin@intevation.de>
parents: 956
diff changeset
116 if (item) {
881984972e0e Added Statusstufe to MessungForm
Dustin Demuth <dustin@intevation.de>
parents: 956
diff changeset
117 r = item.get('stufe');
881984972e0e Added Statusstufe to MessungForm
Dustin Demuth <dustin@intevation.de>
parents: 956
diff changeset
118 }
956
45c67a784b31 Added StatusStufe to the StatusGrid. Created Store and Model for StatusStufe
Dustin Demuth <dustin@intevation.de>
parents: 950
diff changeset
119 return r;
45c67a784b31 Added StatusStufe to the StatusGrid. Created Store and Model for StatusStufe
Dustin Demuth <dustin@intevation.de>
parents: 950
diff changeset
120 },
45c67a784b31 Added StatusStufe to the StatusGrid. Created Store and Model for StatusStufe
Dustin Demuth <dustin@intevation.de>
parents: 950
diff changeset
121 sortable: false,
45c67a784b31 Added StatusStufe to the StatusGrid. Created Store and Model for StatusStufe
Dustin Demuth <dustin@intevation.de>
parents: 950
diff changeset
122 }, {
594
89b337cbfb5d Added status grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
123 header: 'Status',
945
023e622f9551 Added the ability to work with "StatusWerten" which are delivered by the lada-server.
Dustin Demuth <dustin@intevation.de>
parents: 944
diff changeset
124 dataIndex: 'statusWert',
594
89b337cbfb5d Added status grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
125 renderer: function(value) {
958
5d57c6c53e20 Made the grids more robust against erroneous data
Dustin Demuth <dustin@intevation.de>
parents: 957
diff changeset
126 var r;
950
c7bf0b459074 Fixed some issues when the status is null
Dustin Demuth <dustin@intevation.de>
parents: 945
diff changeset
127 if (value===null || value === '') {
958
5d57c6c53e20 Made the grids more robust against erroneous data
Dustin Demuth <dustin@intevation.de>
parents: 957
diff changeset
128 r = 'Error';
594
89b337cbfb5d Added status grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
129 }
957
881984972e0e Added Statusstufe to MessungForm
Dustin Demuth <dustin@intevation.de>
parents: 956
diff changeset
130 var item = statusWerteStore.getById(value);
881984972e0e Added Statusstufe to MessungForm
Dustin Demuth <dustin@intevation.de>
parents: 956
diff changeset
131 if (item) {
881984972e0e Added Statusstufe to MessungForm
Dustin Demuth <dustin@intevation.de>
parents: 956
diff changeset
132 r = item.get('wert');
881984972e0e Added Statusstufe to MessungForm
Dustin Demuth <dustin@intevation.de>
parents: 956
diff changeset
133 }
956
45c67a784b31 Added StatusStufe to the StatusGrid. Created Store and Model for StatusStufe
Dustin Demuth <dustin@intevation.de>
parents: 950
diff changeset
134 return r;
594
89b337cbfb5d Added status grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
135 },
89b337cbfb5d Added status grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
136 editor: {
89b337cbfb5d Added status grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
137 xtype: 'combobox',
956
45c67a784b31 Added StatusStufe to the StatusGrid. Created Store and Model for StatusStufe
Dustin Demuth <dustin@intevation.de>
parents: 950
diff changeset
138 store: statusWerteStore,
945
023e622f9551 Added the ability to work with "StatusWerten" which are delivered by the lada-server.
Dustin Demuth <dustin@intevation.de>
parents: 944
diff changeset
139 displayField: 'wert',
594
89b337cbfb5d Added status grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
140 valueField: 'id',
663
1c5a4b419149 Field Validity in Status Grid
Dustin Demuth <dustin@intevation.de>
parents: 630
diff changeset
141 allowBlank: false,
1c5a4b419149 Field Validity in Status Grid
Dustin Demuth <dustin@intevation.de>
parents: 630
diff changeset
142 editable: false
945
023e622f9551 Added the ability to work with "StatusWerten" which are delivered by the lada-server.
Dustin Demuth <dustin@intevation.de>
parents: 944
diff changeset
143 },
023e622f9551 Added the ability to work with "StatusWerten" which are delivered by the lada-server.
Dustin Demuth <dustin@intevation.de>
parents: 944
diff changeset
144 sortable: false,
594
89b337cbfb5d Added status grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
145 }, {
89b337cbfb5d Added status grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
146 header: 'Text',
945
023e622f9551 Added the ability to work with "StatusWerten" which are delivered by the lada-server.
Dustin Demuth <dustin@intevation.de>
parents: 944
diff changeset
147 dataIndex: 'text',
594
89b337cbfb5d Added status grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
148 flex: 1,
89b337cbfb5d Added status grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
149 editor: {
663
1c5a4b419149 Field Validity in Status Grid
Dustin Demuth <dustin@intevation.de>
parents: 630
diff changeset
150 allowBlank: true,
1c5a4b419149 Field Validity in Status Grid
Dustin Demuth <dustin@intevation.de>
parents: 630
diff changeset
151 maxLength: 1000,
1c5a4b419149 Field Validity in Status Grid
Dustin Demuth <dustin@intevation.de>
parents: 630
diff changeset
152 enforceMaxLength: true
945
023e622f9551 Added the ability to work with "StatusWerten" which are delivered by the lada-server.
Dustin Demuth <dustin@intevation.de>
parents: 944
diff changeset
153 },
023e622f9551 Added the ability to work with "StatusWerten" which are delivered by the lada-server.
Dustin Demuth <dustin@intevation.de>
parents: 944
diff changeset
154 sortable: false,
594
89b337cbfb5d Added status grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
155 }];
824
fab0b7be5aca add disbled remove button to all grids which relate to proben or messungen. Messprogramme-grids are untouched. BUG: When the last entry is deleted, the button remains active
Dustin Demuth <dustin@intevation.de>
parents: 799
diff changeset
156 this.listeners = {
fab0b7be5aca add disbled remove button to all grids which relate to proben or messungen. Messprogramme-grids are untouched. BUG: When the last entry is deleted, the button remains active
Dustin Demuth <dustin@intevation.de>
parents: 799
diff changeset
157 select: {
fab0b7be5aca add disbled remove button to all grids which relate to proben or messungen. Messprogramme-grids are untouched. BUG: When the last entry is deleted, the button remains active
Dustin Demuth <dustin@intevation.de>
parents: 799
diff changeset
158 fn: this.activateRemoveButton,
fab0b7be5aca add disbled remove button to all grids which relate to proben or messungen. Messprogramme-grids are untouched. BUG: When the last entry is deleted, the button remains active
Dustin Demuth <dustin@intevation.de>
parents: 799
diff changeset
159 scope: this
fab0b7be5aca add disbled remove button to all grids which relate to proben or messungen. Messprogramme-grids are untouched. BUG: When the last entry is deleted, the button remains active
Dustin Demuth <dustin@intevation.de>
parents: 799
diff changeset
160 },
fab0b7be5aca add disbled remove button to all grids which relate to proben or messungen. Messprogramme-grids are untouched. BUG: When the last entry is deleted, the button remains active
Dustin Demuth <dustin@intevation.de>
parents: 799
diff changeset
161 deselect: {
fab0b7be5aca add disbled remove button to all grids which relate to proben or messungen. Messprogramme-grids are untouched. BUG: When the last entry is deleted, the button remains active
Dustin Demuth <dustin@intevation.de>
parents: 799
diff changeset
162 fn: this.deactivateRemoveButton,
fab0b7be5aca add disbled remove button to all grids which relate to proben or messungen. Messprogramme-grids are untouched. BUG: When the last entry is deleted, the button remains active
Dustin Demuth <dustin@intevation.de>
parents: 799
diff changeset
163 scope: this
fab0b7be5aca add disbled remove button to all grids which relate to proben or messungen. Messprogramme-grids are untouched. BUG: When the last entry is deleted, the button remains active
Dustin Demuth <dustin@intevation.de>
parents: 799
diff changeset
164 }
fab0b7be5aca add disbled remove button to all grids which relate to proben or messungen. Messprogramme-grids are untouched. BUG: When the last entry is deleted, the button remains active
Dustin Demuth <dustin@intevation.de>
parents: 799
diff changeset
165 };
594
89b337cbfb5d Added status grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
166 this.initData();
89b337cbfb5d Added status grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
167 this.callParent(arguments);
824
fab0b7be5aca add disbled remove button to all grids which relate to proben or messungen. Messprogramme-grids are untouched. BUG: When the last entry is deleted, the button remains active
Dustin Demuth <dustin@intevation.de>
parents: 799
diff changeset
168 this.setReadOnly(true); //Grid is always initialised as RO
594
89b337cbfb5d Added status grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
169 },
89b337cbfb5d Added status grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
170
89b337cbfb5d Added status grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
171 initData: function() {
89b337cbfb5d Added status grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
172 if (this.store) {
89b337cbfb5d Added status grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
173 this.store.removeAll();
89b337cbfb5d Added status grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
174 }
89b337cbfb5d Added status grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
175 else {
89b337cbfb5d Added status grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
176 this.store = Ext.create('Lada.store.Status');
89b337cbfb5d Added status grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
177 }
89b337cbfb5d Added status grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
178 this.store.load({
89b337cbfb5d Added status grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
179 params: {
89b337cbfb5d Added status grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
180 messungsId: this.recordId
89b337cbfb5d Added status grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
181 }
89b337cbfb5d Added status grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
182 });
684
69cb367c0a63 When a Probeform is dirty, all child-grids are made readonly (Row Editing is not disbled correctly). When a Probe is read-only all Child-grid buttons are disabled. When a Probe is ReadOnly probeform is also readonly.
Dustin Demuth <dustin@intevation.de>
parents: 683
diff changeset
183 },
69cb367c0a63 When a Probeform is dirty, all child-grids are made readonly (Row Editing is not disbled correctly). When a Probe is read-only all Child-grid buttons are disabled. When a Probe is ReadOnly probeform is also readonly.
Dustin Demuth <dustin@intevation.de>
parents: 683
diff changeset
184
69cb367c0a63 When a Probeform is dirty, all child-grids are made readonly (Row Editing is not disbled correctly). When a Probe is read-only all Child-grid buttons are disabled. When a Probe is ReadOnly probeform is also readonly.
Dustin Demuth <dustin@intevation.de>
parents: 683
diff changeset
185 setReadOnly: function(b) {
69cb367c0a63 When a Probeform is dirty, all child-grids are made readonly (Row Editing is not disbled correctly). When a Probe is read-only all Child-grid buttons are disabled. When a Probe is ReadOnly probeform is also readonly.
Dustin Demuth <dustin@intevation.de>
parents: 683
diff changeset
186 if (b == true){
69cb367c0a63 When a Probeform is dirty, all child-grids are made readonly (Row Editing is not disbled correctly). When a Probe is read-only all Child-grid buttons are disabled. When a Probe is ReadOnly probeform is also readonly.
Dustin Demuth <dustin@intevation.de>
parents: 683
diff changeset
187 //Readonly
69cb367c0a63 When a Probeform is dirty, all child-grids are made readonly (Row Editing is not disbled correctly). When a Probe is read-only all Child-grid buttons are disabled. When a Probe is ReadOnly probeform is also readonly.
Dustin Demuth <dustin@intevation.de>
parents: 683
diff changeset
188 if (this.getPlugin('rowedit')){
69cb367c0a63 When a Probeform is dirty, all child-grids are made readonly (Row Editing is not disbled correctly). When a Probe is read-only all Child-grid buttons are disabled. When a Probe is ReadOnly probeform is also readonly.
Dustin Demuth <dustin@intevation.de>
parents: 683
diff changeset
189 this.getPlugin('rowedit').disable();
69cb367c0a63 When a Probeform is dirty, all child-grids are made readonly (Row Editing is not disbled correctly). When a Probe is read-only all Child-grid buttons are disabled. When a Probe is ReadOnly probeform is also readonly.
Dustin Demuth <dustin@intevation.de>
parents: 683
diff changeset
190 }
69cb367c0a63 When a Probeform is dirty, all child-grids are made readonly (Row Editing is not disbled correctly). When a Probe is read-only all Child-grid buttons are disabled. When a Probe is ReadOnly probeform is also readonly.
Dustin Demuth <dustin@intevation.de>
parents: 683
diff changeset
191 this.down('button[action=delete]').disable();
69cb367c0a63 When a Probeform is dirty, all child-grids are made readonly (Row Editing is not disbled correctly). When a Probe is read-only all Child-grid buttons are disabled. When a Probe is ReadOnly probeform is also readonly.
Dustin Demuth <dustin@intevation.de>
parents: 683
diff changeset
192 this.down('button[action=add]').disable();
69cb367c0a63 When a Probeform is dirty, all child-grids are made readonly (Row Editing is not disbled correctly). When a Probe is read-only all Child-grid buttons are disabled. When a Probe is ReadOnly probeform is also readonly.
Dustin Demuth <dustin@intevation.de>
parents: 683
diff changeset
193 }else{
69cb367c0a63 When a Probeform is dirty, all child-grids are made readonly (Row Editing is not disbled correctly). When a Probe is read-only all Child-grid buttons are disabled. When a Probe is ReadOnly probeform is also readonly.
Dustin Demuth <dustin@intevation.de>
parents: 683
diff changeset
194 //Writable
69cb367c0a63 When a Probeform is dirty, all child-grids are made readonly (Row Editing is not disbled correctly). When a Probe is read-only all Child-grid buttons are disabled. When a Probe is ReadOnly probeform is also readonly.
Dustin Demuth <dustin@intevation.de>
parents: 683
diff changeset
195 if (this.getPlugin('rowedit')){
69cb367c0a63 When a Probeform is dirty, all child-grids are made readonly (Row Editing is not disbled correctly). When a Probe is read-only all Child-grid buttons are disabled. When a Probe is ReadOnly probeform is also readonly.
Dustin Demuth <dustin@intevation.de>
parents: 683
diff changeset
196 this.getPlugin('rowedit').enable();
69cb367c0a63 When a Probeform is dirty, all child-grids are made readonly (Row Editing is not disbled correctly). When a Probe is read-only all Child-grid buttons are disabled. When a Probe is ReadOnly probeform is also readonly.
Dustin Demuth <dustin@intevation.de>
parents: 683
diff changeset
197 }
824
fab0b7be5aca add disbled remove button to all grids which relate to proben or messungen. Messprogramme-grids are untouched. BUG: When the last entry is deleted, the button remains active
Dustin Demuth <dustin@intevation.de>
parents: 799
diff changeset
198 //this.down('button[action=delete]').enable();
684
69cb367c0a63 When a Probeform is dirty, all child-grids are made readonly (Row Editing is not disbled correctly). When a Probe is read-only all Child-grid buttons are disabled. When a Probe is ReadOnly probeform is also readonly.
Dustin Demuth <dustin@intevation.de>
parents: 683
diff changeset
199 this.down('button[action=add]').enable();
69cb367c0a63 When a Probeform is dirty, all child-grids are made readonly (Row Editing is not disbled correctly). When a Probe is read-only all Child-grid buttons are disabled. When a Probe is ReadOnly probeform is also readonly.
Dustin Demuth <dustin@intevation.de>
parents: 683
diff changeset
200 }
824
fab0b7be5aca add disbled remove button to all grids which relate to proben or messungen. Messprogramme-grids are untouched. BUG: When the last entry is deleted, the button remains active
Dustin Demuth <dustin@intevation.de>
parents: 799
diff changeset
201 },
fab0b7be5aca add disbled remove button to all grids which relate to proben or messungen. Messprogramme-grids are untouched. BUG: When the last entry is deleted, the button remains active
Dustin Demuth <dustin@intevation.de>
parents: 799
diff changeset
202 /**
945
023e622f9551 Added the ability to work with "StatusWerten" which are delivered by the lada-server.
Dustin Demuth <dustin@intevation.de>
parents: 944
diff changeset
203 * Activate the "Remove Button"
824
fab0b7be5aca add disbled remove button to all grids which relate to proben or messungen. Messprogramme-grids are untouched. BUG: When the last entry is deleted, the button remains active
Dustin Demuth <dustin@intevation.de>
parents: 799
diff changeset
204 */
fab0b7be5aca add disbled remove button to all grids which relate to proben or messungen. Messprogramme-grids are untouched. BUG: When the last entry is deleted, the button remains active
Dustin Demuth <dustin@intevation.de>
parents: 799
diff changeset
205 activateRemoveButton: function(selection, record) {
fab0b7be5aca add disbled remove button to all grids which relate to proben or messungen. Messprogramme-grids are untouched. BUG: When the last entry is deleted, the button remains active
Dustin Demuth <dustin@intevation.de>
parents: 799
diff changeset
206 var grid = this;
fab0b7be5aca add disbled remove button to all grids which relate to proben or messungen. Messprogramme-grids are untouched. BUG: When the last entry is deleted, the button remains active
Dustin Demuth <dustin@intevation.de>
parents: 799
diff changeset
207 //only enable the remove buttone, when the grid is editable.
fab0b7be5aca add disbled remove button to all grids which relate to proben or messungen. Messprogramme-grids are untouched. BUG: When the last entry is deleted, the button remains active
Dustin Demuth <dustin@intevation.de>
parents: 799
diff changeset
208 if (! grid.readOnly) {
fab0b7be5aca add disbled remove button to all grids which relate to proben or messungen. Messprogramme-grids are untouched. BUG: When the last entry is deleted, the button remains active
Dustin Demuth <dustin@intevation.de>
parents: 799
diff changeset
209 grid.down('button[action=delete]').enable();
fab0b7be5aca add disbled remove button to all grids which relate to proben or messungen. Messprogramme-grids are untouched. BUG: When the last entry is deleted, the button remains active
Dustin Demuth <dustin@intevation.de>
parents: 799
diff changeset
210 }
fab0b7be5aca add disbled remove button to all grids which relate to proben or messungen. Messprogramme-grids are untouched. BUG: When the last entry is deleted, the button remains active
Dustin Demuth <dustin@intevation.de>
parents: 799
diff changeset
211 },
fab0b7be5aca add disbled remove button to all grids which relate to proben or messungen. Messprogramme-grids are untouched. BUG: When the last entry is deleted, the button remains active
Dustin Demuth <dustin@intevation.de>
parents: 799
diff changeset
212 /**
945
023e622f9551 Added the ability to work with "StatusWerten" which are delivered by the lada-server.
Dustin Demuth <dustin@intevation.de>
parents: 944
diff changeset
213 * Deactivate the "Remove Button"
824
fab0b7be5aca add disbled remove button to all grids which relate to proben or messungen. Messprogramme-grids are untouched. BUG: When the last entry is deleted, the button remains active
Dustin Demuth <dustin@intevation.de>
parents: 799
diff changeset
214 */
fab0b7be5aca add disbled remove button to all grids which relate to proben or messungen. Messprogramme-grids are untouched. BUG: When the last entry is deleted, the button remains active
Dustin Demuth <dustin@intevation.de>
parents: 799
diff changeset
215 deactivateRemoveButton: function(selection, record) {
fab0b7be5aca add disbled remove button to all grids which relate to proben or messungen. Messprogramme-grids are untouched. BUG: When the last entry is deleted, the button remains active
Dustin Demuth <dustin@intevation.de>
parents: 799
diff changeset
216 var grid = this;
fab0b7be5aca add disbled remove button to all grids which relate to proben or messungen. Messprogramme-grids are untouched. BUG: When the last entry is deleted, the button remains active
Dustin Demuth <dustin@intevation.de>
parents: 799
diff changeset
217 //only enable the remove buttone, when the grid is editable.
fab0b7be5aca add disbled remove button to all grids which relate to proben or messungen. Messprogramme-grids are untouched. BUG: When the last entry is deleted, the button remains active
Dustin Demuth <dustin@intevation.de>
parents: 799
diff changeset
218 if (! grid.readOnly) {
fab0b7be5aca add disbled remove button to all grids which relate to proben or messungen. Messprogramme-grids are untouched. BUG: When the last entry is deleted, the button remains active
Dustin Demuth <dustin@intevation.de>
parents: 799
diff changeset
219 grid.down('button[action=delete]').disable();
fab0b7be5aca add disbled remove button to all grids which relate to proben or messungen. Messprogramme-grids are untouched. BUG: When the last entry is deleted, the button remains active
Dustin Demuth <dustin@intevation.de>
parents: 799
diff changeset
220 }
594
89b337cbfb5d Added status grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
221 }
89b337cbfb5d Added status grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
222 });

http://lada.wald.intevation.org