annotate app/view/grid/Status.js @ 1309:1bcc3a62e909

insert and preset OrtId field on Orterstellung
author Maximilian Krambach <mkrambach@intevation.de>
date Thu, 02 Feb 2017 16:59:25 +0100
parents 3b4dcc83a21b
children
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 minHeight: 110,
89b337cbfb5d Added status grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
18 viewConfig: {
89b337cbfb5d Added status grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
19 deferEmptyText: false
89b337cbfb5d Added status grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
20 },
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 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
23 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
24 allowDeselect: true,
1000
5beb2581a989 A fix which is supposed to reload the statuswerte store, when the Add button is used
Dustin Demuth <dustin@intevation.de>
parents: 998
diff changeset
25 statusWerteStore: null,
1217
4270da0f7d3b Merged branch schema-update into default.
Tom Gottfried <tom@intevation.de>
parents: 1044
diff changeset
26 statusStufeStore: null,
594
89b337cbfb5d Added status grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
27
89b337cbfb5d Added status grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
28 initComponent: function() {
998
4bbb3da88c14 Statusreset: added a confirmation dialog and i18n
Dustin Demuth <dustin@intevation.de>
parents: 996
diff changeset
29 var i18n = Lada.getApplication().bundle;
4bbb3da88c14 Statusreset: added a confirmation dialog and i18n
Dustin Demuth <dustin@intevation.de>
parents: 996
diff changeset
30 this.emptyText = i18n.getMsg('statusgrid.emptyText');
4bbb3da88c14 Statusreset: added a confirmation dialog and i18n
Dustin Demuth <dustin@intevation.de>
parents: 996
diff changeset
31
1000
5beb2581a989 A fix which is supposed to reload the statuswerte store, when the Add button is used
Dustin Demuth <dustin@intevation.de>
parents: 998
diff changeset
32 this.statusWerteStore = Ext.create('Lada.store.StatusWerte');
1001
e92931b8f6b0 A fix which is supposed to reload the statuswerte store, when the Add button is used, part 2
Dustin Demuth <dustin@intevation.de>
parents: 1000
diff changeset
33 this.statusWerteStore.load({
963
6a6f2c6fe8ee More work done on StatusWerte and Statusstufe. A Messung will also open when the owner attribute is true. Stauswerte and StatusStufen are loaded at application startup. Statusgrid and Messunggrid now use these stores, which were registered at the store manager.
Dustin Demuth <dustin@intevation.de>
parents: 961
diff changeset
34 params: {
6a6f2c6fe8ee More work done on StatusWerte and Statusstufe. A Messung will also open when the owner attribute is true. Stauswerte and StatusStufen are loaded at application startup. Statusgrid and Messunggrid now use these stores, which were registered at the store manager.
Dustin Demuth <dustin@intevation.de>
parents: 961
diff changeset
35 messungsId: this.recordId
6a6f2c6fe8ee More work done on StatusWerte and Statusstufe. A Messung will also open when the owner attribute is true. Stauswerte and StatusStufen are loaded at application startup. Statusgrid and Messunggrid now use these stores, which were registered at the store manager.
Dustin Demuth <dustin@intevation.de>
parents: 961
diff changeset
36 }
6a6f2c6fe8ee More work done on StatusWerte and Statusstufe. A Messung will also open when the owner attribute is true. Stauswerte and StatusStufen are loaded at application startup. Statusgrid and Messunggrid now use these stores, which were registered at the store manager.
Dustin Demuth <dustin@intevation.de>
parents: 961
diff changeset
37 });
1217
4270da0f7d3b Merged branch schema-update into default.
Tom Gottfried <tom@intevation.de>
parents: 1044
diff changeset
38 this.statusStufeStore = Ext.create('Lada.store.StatusStufe');
4270da0f7d3b Merged branch schema-update into default.
Tom Gottfried <tom@intevation.de>
parents: 1044
diff changeset
39 this.statusStufeStore.load();
963
6a6f2c6fe8ee More work done on StatusWerte and Statusstufe. A Messung will also open when the owner attribute is true. Stauswerte and StatusStufen are loaded at application startup. Statusgrid and Messunggrid now use these stores, which were registered at the store manager.
Dustin Demuth <dustin@intevation.de>
parents: 961
diff changeset
40
594
89b337cbfb5d Added status grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
41 this.rowEditing = Ext.create('Ext.grid.plugin.RowEditing', {
89b337cbfb5d Added status grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
42 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
43 autoCancel: false,
990
c2a726887dd7 The last status can not be edited anymore. When a new status is added, the new record is preset with ALL previous variables, this includes the StatusStufe! The Date is corrected to the current date. Also the store is sorted by Datum now.
Dustin Demuth <dustin@intevation.de>
parents: 969
diff changeset
44 disabled: true, //has no effect... but why?
c2a726887dd7 The last status can not be edited anymore. When a new status is added, the new record is preset with ALL previous variables, this includes the StatusStufe! The Date is corrected to the current date. Also the store is sorted by Datum now.
Dustin Demuth <dustin@intevation.de>
parents: 969
diff changeset
45 pluginId: 'rowedit',
c2a726887dd7 The last status can not be edited anymore. When a new status is added, the new record is preset with ALL previous variables, this includes the StatusStufe! The Date is corrected to the current date. Also the store is sorted by Datum now.
Dustin Demuth <dustin@intevation.de>
parents: 969
diff changeset
46 listeners: {
c2a726887dd7 The last status can not be edited anymore. When a new status is added, the new record is preset with ALL previous variables, this includes the StatusStufe! The Date is corrected to the current date. Also the store is sorted by Datum now.
Dustin Demuth <dustin@intevation.de>
parents: 969
diff changeset
47 beforeedit: function(editor, context, eOpts) {
c2a726887dd7 The last status can not be edited anymore. When a new status is added, the new record is preset with ALL previous variables, this includes the StatusStufe! The Date is corrected to the current date. Also the store is sorted by Datum now.
Dustin Demuth <dustin@intevation.de>
parents: 969
diff changeset
48 if (context.record.get('id') ||
c2a726887dd7 The last status can not be edited anymore. When a new status is added, the new record is preset with ALL previous variables, this includes the StatusStufe! The Date is corrected to the current date. Also the store is sorted by Datum now.
Dustin Demuth <dustin@intevation.de>
parents: 969
diff changeset
49 ! context.grid.up('window').record.get('statusEdit')) {
c2a726887dd7 The last status can not be edited anymore. When a new status is added, the new record is preset with ALL previous variables, this includes the StatusStufe! The Date is corrected to the current date. Also the store is sorted by Datum now.
Dustin Demuth <dustin@intevation.de>
parents: 969
diff changeset
50 //Check if edit is allowed, this is true, when the selected
c2a726887dd7 The last status can not be edited anymore. When a new status is added, the new record is preset with ALL previous variables, this includes the StatusStufe! The Date is corrected to the current date. Also the store is sorted by Datum now.
Dustin Demuth <dustin@intevation.de>
parents: 969
diff changeset
51 // Record has an id (=is not new)
c2a726887dd7 The last status can not be edited anymore. When a new status is added, the new record is preset with ALL previous variables, this includes the StatusStufe! The Date is corrected to the current date. Also the store is sorted by Datum now.
Dustin Demuth <dustin@intevation.de>
parents: 969
diff changeset
52 // or is not allowed to add records.
c2a726887dd7 The last status can not be edited anymore. When a new status is added, the new record is preset with ALL previous variables, this includes the StatusStufe! The Date is corrected to the current date. Also the store is sorted by Datum now.
Dustin Demuth <dustin@intevation.de>
parents: 969
diff changeset
53
c2a726887dd7 The last status can not be edited anymore. When a new status is added, the new record is preset with ALL previous variables, this includes the StatusStufe! The Date is corrected to the current date. Also the store is sorted by Datum now.
Dustin Demuth <dustin@intevation.de>
parents: 969
diff changeset
54 return false;
c2a726887dd7 The last status can not be edited anymore. When a new status is added, the new record is preset with ALL previous variables, this includes the StatusStufe! The Date is corrected to the current date. Also the store is sorted by Datum now.
Dustin Demuth <dustin@intevation.de>
parents: 969
diff changeset
55 }
c2a726887dd7 The last status can not be edited anymore. When a new status is added, the new record is preset with ALL previous variables, this includes the StatusStufe! The Date is corrected to the current date. Also the store is sorted by Datum now.
Dustin Demuth <dustin@intevation.de>
parents: 969
diff changeset
56
c2a726887dd7 The last status can not be edited anymore. When a new status is added, the new record is preset with ALL previous variables, this includes the StatusStufe! The Date is corrected to the current date. Also the store is sorted by Datum now.
Dustin Demuth <dustin@intevation.de>
parents: 969
diff changeset
57
c2a726887dd7 The last status can not be edited anymore. When a new status is added, the new record is preset with ALL previous variables, this includes the StatusStufe! The Date is corrected to the current date. Also the store is sorted by Datum now.
Dustin Demuth <dustin@intevation.de>
parents: 969
diff changeset
58 }
c2a726887dd7 The last status can not be edited anymore. When a new status is added, the new record is preset with ALL previous variables, this includes the StatusStufe! The Date is corrected to the current date. Also the store is sorted by Datum now.
Dustin Demuth <dustin@intevation.de>
parents: 969
diff changeset
59 }
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
60 });
594
89b337cbfb5d Added status grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
61 this.plugins = [this.rowEditing];
89b337cbfb5d Added status grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
62
89b337cbfb5d Added status grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
63 this.dockedItems = [{
89b337cbfb5d Added status grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
64 xtype: 'toolbar',
89b337cbfb5d Added status grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
65 dock: 'bottom',
89b337cbfb5d Added status grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
66 items: ['->', {
998
4bbb3da88c14 Statusreset: added a confirmation dialog and i18n
Dustin Demuth <dustin@intevation.de>
parents: 996
diff changeset
67 text: i18n.getMsg('reset'),
994
092e245b13a4 draft implementation of the status-reset function: Todo: move this into a 'confirmation dialog'
Dustin Demuth <dustin@intevation.de>
parents: 990
diff changeset
68 icon: 'resources/img/edit-redo.png',
092e245b13a4 draft implementation of the status-reset function: Todo: move this into a 'confirmation dialog'
Dustin Demuth <dustin@intevation.de>
parents: 990
diff changeset
69 action: 'reset',
092e245b13a4 draft implementation of the status-reset function: Todo: move this into a 'confirmation dialog'
Dustin Demuth <dustin@intevation.de>
parents: 990
diff changeset
70 probeId: this.probeId,
092e245b13a4 draft implementation of the status-reset function: Todo: move this into a 'confirmation dialog'
Dustin Demuth <dustin@intevation.de>
parents: 990
diff changeset
71 parentId: this.parentId
092e245b13a4 draft implementation of the status-reset function: Todo: move this into a 'confirmation dialog'
Dustin Demuth <dustin@intevation.de>
parents: 990
diff changeset
72 }, {
998
4bbb3da88c14 Statusreset: added a confirmation dialog and i18n
Dustin Demuth <dustin@intevation.de>
parents: 996
diff changeset
73 text: i18n.getMsg('add'),
594
89b337cbfb5d Added status grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
74 icon: 'resources/img/list-add.png',
89b337cbfb5d Added status grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
75 action: 'add',
89b337cbfb5d Added status grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
76 probeId: this.probeId,
89b337cbfb5d Added status grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
77 parentId: this.parentId
89b337cbfb5d Added status grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
78 }]
89b337cbfb5d Added status grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
79 }];
89b337cbfb5d Added status grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
80 this.columns = [{
998
4bbb3da88c14 Statusreset: added a confirmation dialog and i18n
Dustin Demuth <dustin@intevation.de>
parents: 996
diff changeset
81 header: i18n.getMsg('statusgrid.header.datum'),
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 dataIndex: 'datum',
944
1f1467713c3f Status grid modified
Michael Stanko <mstanko@bfs.de>
parents: 893
diff changeset
83 xtype: 'datecolumn',
1f1467713c3f Status grid modified
Michael Stanko <mstanko@bfs.de>
parents: 893
diff changeset
84 format: 'd.m.Y H:i',
1f1467713c3f Status grid modified
Michael Stanko <mstanko@bfs.de>
parents: 893
diff changeset
85 width: 110,
965
a2c2039bb5d9 Disabled StatusGrid Edit when StatusEdit ist false, Load StatuswerteStore differently, removed a bunch of trailing commas
Dustin Demuth <dustin@intevation.de>
parents: 964
diff changeset
86 sortable: false
944
1f1467713c3f Status grid modified
Michael Stanko <mstanko@bfs.de>
parents: 893
diff changeset
87 }, {
998
4bbb3da88c14 Statusreset: added a confirmation dialog and i18n
Dustin Demuth <dustin@intevation.de>
parents: 996
diff changeset
88 header: i18n.getMsg('statusgrid.header.erzeuger'),
1217
4270da0f7d3b Merged branch schema-update into default.
Tom Gottfried <tom@intevation.de>
parents: 1044
diff changeset
89 dataIndex: 'mstId',
594
89b337cbfb5d Added status grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
90 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
91 var r = '';
594
89b337cbfb5d Added status grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
92 if (!value || value === '') {
998
4bbb3da88c14 Statusreset: added a confirmation dialog and i18n
Dustin Demuth <dustin@intevation.de>
parents: 996
diff changeset
93 r = i18n.getMsg('error');
594
89b337cbfb5d Added status grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
94 }
89b337cbfb5d Added status grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
95 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
96 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
97 if (item) {
6f1cc3316e2d Intermediate Result. When creating a Messung a Statuswert will be set.
Dustin Demuth <dustin@intevation.de>
parents: 958
diff changeset
98 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
99 }
6f1cc3316e2d Intermediate Result. When creating a Messung a Statuswert will be set.
Dustin Demuth <dustin@intevation.de>
parents: 958
diff changeset
100 return r;
594
89b337cbfb5d Added status grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
101 },
89b337cbfb5d Added status grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
102 editor: {
89b337cbfb5d Added status grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
103 xtype: 'combobox',
967
50d7b6e17525 Filter the selectable Messtellen in the statusgrid
Dustin Demuth <dustin@intevation.de>
parents: 965
diff changeset
104 store: Ext.data.StoreManager.get('messstellenFiltered'),
594
89b337cbfb5d Added status grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
105 displayField: 'messStelle',
89b337cbfb5d Added status grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
106 valueField: 'id',
663
1c5a4b419149 Field Validity in Status Grid
Dustin Demuth <dustin@intevation.de>
parents: 630
diff changeset
107 allowBlank: false,
1044
8e579acfe0b1 Set preselected messstelle in status editor.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1037
diff changeset
108 queryMode: 'local',
8e579acfe0b1 Set preselected messstelle in status editor.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1037
diff changeset
109 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
110 },
965
a2c2039bb5d9 Disabled StatusGrid Edit when StatusEdit ist false, Load StatuswerteStore differently, removed a bunch of trailing commas
Dustin Demuth <dustin@intevation.de>
parents: 964
diff changeset
111 sortable: false
594
89b337cbfb5d Added status grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
112 }, {
998
4bbb3da88c14 Statusreset: added a confirmation dialog and i18n
Dustin Demuth <dustin@intevation.de>
parents: 996
diff changeset
113 header: i18n.getMsg('statusgrid.header.statusStufe'),
1217
4270da0f7d3b Merged branch schema-update into default.
Tom Gottfried <tom@intevation.de>
parents: 1044
diff changeset
114 dataIndex: 'statusKombi',
956
45c67a784b31 Added StatusStufe to the StatusGrid. Created Store and Model for StatusStufe
Dustin Demuth <dustin@intevation.de>
parents: 950
diff changeset
115 renderer: function(value) {
1217
4270da0f7d3b Merged branch schema-update into default.
Tom Gottfried <tom@intevation.de>
parents: 1044
diff changeset
116 var kombi = Ext.data.StoreManager.get('statuskombi');
4270da0f7d3b Merged branch schema-update into default.
Tom Gottfried <tom@intevation.de>
parents: 1044
diff changeset
117 var r = '';
4270da0f7d3b Merged branch schema-update into default.
Tom Gottfried <tom@intevation.de>
parents: 1044
diff changeset
118 var item = kombi.getById(value);
957
881984972e0e Added Statusstufe to MessungForm
Dustin Demuth <dustin@intevation.de>
parents: 956
diff changeset
119 if (item) {
1217
4270da0f7d3b Merged branch schema-update into default.
Tom Gottfried <tom@intevation.de>
parents: 1044
diff changeset
120 r = item.raw.statusStufe.stufe;
957
881984972e0e Added Statusstufe to MessungForm
Dustin Demuth <dustin@intevation.de>
parents: 956
diff changeset
121 }
956
45c67a784b31 Added StatusStufe to the StatusGrid. Created Store and Model for StatusStufe
Dustin Demuth <dustin@intevation.de>
parents: 950
diff changeset
122 return r;
45c67a784b31 Added StatusStufe to the StatusGrid. Created Store and Model for StatusStufe
Dustin Demuth <dustin@intevation.de>
parents: 950
diff changeset
123 },
1217
4270da0f7d3b Merged branch schema-update into default.
Tom Gottfried <tom@intevation.de>
parents: 1044
diff changeset
124 editor: {
4270da0f7d3b Merged branch schema-update into default.
Tom Gottfried <tom@intevation.de>
parents: 1044
diff changeset
125 xtype: 'combobox',
4270da0f7d3b Merged branch schema-update into default.
Tom Gottfried <tom@intevation.de>
parents: 1044
diff changeset
126 store: this.statusStufeStore,
4270da0f7d3b Merged branch schema-update into default.
Tom Gottfried <tom@intevation.de>
parents: 1044
diff changeset
127 queryMode: 'local',
4270da0f7d3b Merged branch schema-update into default.
Tom Gottfried <tom@intevation.de>
parents: 1044
diff changeset
128 displayField: 'stufe',
4270da0f7d3b Merged branch schema-update into default.
Tom Gottfried <tom@intevation.de>
parents: 1044
diff changeset
129 valueField: 'id',
4270da0f7d3b Merged branch schema-update into default.
Tom Gottfried <tom@intevation.de>
parents: 1044
diff changeset
130 allowBlank: false,
4270da0f7d3b Merged branch schema-update into default.
Tom Gottfried <tom@intevation.de>
parents: 1044
diff changeset
131 editable: false,
4270da0f7d3b Merged branch schema-update into default.
Tom Gottfried <tom@intevation.de>
parents: 1044
diff changeset
132 forceSelection: true
4270da0f7d3b Merged branch schema-update into default.
Tom Gottfried <tom@intevation.de>
parents: 1044
diff changeset
133 },
965
a2c2039bb5d9 Disabled StatusGrid Edit when StatusEdit ist false, Load StatuswerteStore differently, removed a bunch of trailing commas
Dustin Demuth <dustin@intevation.de>
parents: 964
diff changeset
134 sortable: false
956
45c67a784b31 Added StatusStufe to the StatusGrid. Created Store and Model for StatusStufe
Dustin Demuth <dustin@intevation.de>
parents: 950
diff changeset
135 }, {
998
4bbb3da88c14 Statusreset: added a confirmation dialog and i18n
Dustin Demuth <dustin@intevation.de>
parents: 996
diff changeset
136 header: i18n.getMsg('statusgrid.header.statusWert'),
1217
4270da0f7d3b Merged branch schema-update into default.
Tom Gottfried <tom@intevation.de>
parents: 1044
diff changeset
137 dataIndex: 'statusKombi',
594
89b337cbfb5d Added status grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
138 renderer: function(value) {
1217
4270da0f7d3b Merged branch schema-update into default.
Tom Gottfried <tom@intevation.de>
parents: 1044
diff changeset
139 var kombi = Ext.data.StoreManager.get('statuskombi');
963
6a6f2c6fe8ee More work done on StatusWerte and Statusstufe. A Messung will also open when the owner attribute is true. Stauswerte and StatusStufen are loaded at application startup. Statusgrid and Messunggrid now use these stores, which were registered at the store manager.
Dustin Demuth <dustin@intevation.de>
parents: 961
diff changeset
140 //This store is NOT used in the editor...
1217
4270da0f7d3b Merged branch schema-update into default.
Tom Gottfried <tom@intevation.de>
parents: 1044
diff changeset
141 var r = '';
4270da0f7d3b Merged branch schema-update into default.
Tom Gottfried <tom@intevation.de>
parents: 1044
diff changeset
142 var item = kombi.getById(value);
957
881984972e0e Added Statusstufe to MessungForm
Dustin Demuth <dustin@intevation.de>
parents: 956
diff changeset
143 if (item) {
1217
4270da0f7d3b Merged branch schema-update into default.
Tom Gottfried <tom@intevation.de>
parents: 1044
diff changeset
144 r = item.raw.statusWert.wert;
957
881984972e0e Added Statusstufe to MessungForm
Dustin Demuth <dustin@intevation.de>
parents: 956
diff changeset
145 }
956
45c67a784b31 Added StatusStufe to the StatusGrid. Created Store and Model for StatusStufe
Dustin Demuth <dustin@intevation.de>
parents: 950
diff changeset
146 return r;
594
89b337cbfb5d Added status grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
147 },
89b337cbfb5d Added status grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
148 editor: {
89b337cbfb5d Added status grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
149 xtype: 'combobox',
1001
e92931b8f6b0 A fix which is supposed to reload the statuswerte store, when the Add button is used, part 2
Dustin Demuth <dustin@intevation.de>
parents: 1000
diff changeset
150 store: this.statusWerteStore,
968
8fabf9a3fee7 Make a local query for the statusWerteStore
Dustin Demuth <dustin@intevation.de>
parents: 967
diff changeset
151 queryMode: 'local',
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
152 displayField: 'wert',
594
89b337cbfb5d Added status grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
153 valueField: 'id',
663
1c5a4b419149 Field Validity in Status Grid
Dustin Demuth <dustin@intevation.de>
parents: 630
diff changeset
154 allowBlank: false,
1027
859e2e9859cd Fixed an issue concerning the selection of status
Dustin Demuth <dustin@intevation.de>
parents: 1017
diff changeset
155 editable: false,
859e2e9859cd Fixed an issue concerning the selection of status
Dustin Demuth <dustin@intevation.de>
parents: 1017
diff changeset
156 forceSelection: 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
157 },
965
a2c2039bb5d9 Disabled StatusGrid Edit when StatusEdit ist false, Load StatuswerteStore differently, removed a bunch of trailing commas
Dustin Demuth <dustin@intevation.de>
parents: 964
diff changeset
158 sortable: false
594
89b337cbfb5d Added status grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
159 }, {
998
4bbb3da88c14 Statusreset: added a confirmation dialog and i18n
Dustin Demuth <dustin@intevation.de>
parents: 996
diff changeset
160 header: i18n.getMsg('statusgrid.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
161 dataIndex: 'text',
594
89b337cbfb5d Added status grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
162 flex: 1,
89b337cbfb5d Added status grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
163 editor: {
663
1c5a4b419149 Field Validity in Status Grid
Dustin Demuth <dustin@intevation.de>
parents: 630
diff changeset
164 allowBlank: true,
1c5a4b419149 Field Validity in Status Grid
Dustin Demuth <dustin@intevation.de>
parents: 630
diff changeset
165 maxLength: 1000,
1c5a4b419149 Field Validity in Status Grid
Dustin Demuth <dustin@intevation.de>
parents: 630
diff changeset
166 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
167 },
965
a2c2039bb5d9 Disabled StatusGrid Edit when StatusEdit ist false, Load StatuswerteStore differently, removed a bunch of trailing commas
Dustin Demuth <dustin@intevation.de>
parents: 964
diff changeset
168 sortable: false
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 this.initData();
89b337cbfb5d Added status grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
171 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
172 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
173 },
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 initData: function() {
89b337cbfb5d Added status grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
176 if (this.store) {
89b337cbfb5d Added status grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
177 this.store.removeAll();
89b337cbfb5d Added status grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
178 }
89b337cbfb5d Added status grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
179 else {
990
c2a726887dd7 The last status can not be edited anymore. When a new status is added, the new record is preset with ALL previous variables, this includes the StatusStufe! The Date is corrected to the current date. Also the store is sorted by Datum now.
Dustin Demuth <dustin@intevation.de>
parents: 969
diff changeset
180 this.store = Ext.create('Lada.store.Status',{
c2a726887dd7 The last status can not be edited anymore. When a new status is added, the new record is preset with ALL previous variables, this includes the StatusStufe! The Date is corrected to the current date. Also the store is sorted by Datum now.
Dustin Demuth <dustin@intevation.de>
parents: 969
diff changeset
181 sorters: [{
c2a726887dd7 The last status can not be edited anymore. When a new status is added, the new record is preset with ALL previous variables, this includes the StatusStufe! The Date is corrected to the current date. Also the store is sorted by Datum now.
Dustin Demuth <dustin@intevation.de>
parents: 969
diff changeset
182 property: 'datum',
c2a726887dd7 The last status can not be edited anymore. When a new status is added, the new record is preset with ALL previous variables, this includes the StatusStufe! The Date is corrected to the current date. Also the store is sorted by Datum now.
Dustin Demuth <dustin@intevation.de>
parents: 969
diff changeset
183 direction: 'ASC'
c2a726887dd7 The last status can not be edited anymore. When a new status is added, the new record is preset with ALL previous variables, this includes the StatusStufe! The Date is corrected to the current date. Also the store is sorted by Datum now.
Dustin Demuth <dustin@intevation.de>
parents: 969
diff changeset
184 }]
c2a726887dd7 The last status can not be edited anymore. When a new status is added, the new record is preset with ALL previous variables, this includes the StatusStufe! The Date is corrected to the current date. Also the store is sorted by Datum now.
Dustin Demuth <dustin@intevation.de>
parents: 969
diff changeset
185 });
594
89b337cbfb5d Added status grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
186 }
1017
d8e74bd89d6b Fixed Activation of StatusReset Button
Dustin Demuth <dustin@intevation.de>
parents: 1001
diff changeset
187
594
89b337cbfb5d Added status grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
188 this.store.load({
89b337cbfb5d Added status grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
189 params: {
1280
3b4dcc83a21b fix sencha compile warnings
Michael Stanko <mstanko@bfs.de>
parents: 1217
diff changeset
190 messungsId: this.recordId
594
89b337cbfb5d Added status grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
191 }
89b337cbfb5d Added status grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
192 });
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
193 },
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
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 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
196 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
197 //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
198 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
199 }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
200 //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
201 this.down('button[action=add]').enable();
996
bf7bb9583a40 Statusworkflow: More work on the reset Button
Dustin Demuth <dustin@intevation.de>
parents: 994
diff changeset
202 }
bf7bb9583a40 Statusworkflow: More work on the reset Button
Dustin Demuth <dustin@intevation.de>
parents: 994
diff changeset
203 },
bf7bb9583a40 Statusworkflow: More work on the reset Button
Dustin Demuth <dustin@intevation.de>
parents: 994
diff changeset
204
bf7bb9583a40 Statusworkflow: More work on the reset Button
Dustin Demuth <dustin@intevation.de>
parents: 994
diff changeset
205 setResetable: function(b) {
bf7bb9583a40 Statusworkflow: More work on the reset Button
Dustin Demuth <dustin@intevation.de>
parents: 994
diff changeset
206 if (b == true){
994
092e245b13a4 draft implementation of the status-reset function: Todo: move this into a 'confirmation dialog'
Dustin Demuth <dustin@intevation.de>
parents: 990
diff changeset
207 this.down('button[action=reset]').enable();
996
bf7bb9583a40 Statusworkflow: More work on the reset Button
Dustin Demuth <dustin@intevation.de>
parents: 994
diff changeset
208 }else{
bf7bb9583a40 Statusworkflow: More work on the reset Button
Dustin Demuth <dustin@intevation.de>
parents: 994
diff changeset
209 this.down('button[action=reset]').disable();
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
210 }
594
89b337cbfb5d Added status grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
211 }
89b337cbfb5d Added status grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
212 });

http://lada.wald.intevation.org