annotate app/view/grid/Messwert.js @ 1127:5941ee0c7247

Do not constrain range of values. Zero and (e.g. for temperature) even negative values have to be possible. As numbers with exponent >99 are unlikely, they are displayed as they are.
author Tom Gottfried <tom@intevation.de>
date Tue, 24 May 2016 15:20:01 +0200
parents 4f68511ce7a4
children d3cf992099a0
rev   line source
590
e440b66a859f Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
1 /* Copyright (C) 2013 by Bundesamt fuer Strahlenschutz
e440b66a859f Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
2 * Software engineering by Intevation GmbH
e440b66a859f Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
3 *
e440b66a859f Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
4 * This file is Free Software under the GNU GPL (v>=3)
e440b66a859f Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
5 * and comes with ABSOLUTELY NO WARRANTY! Check out
e440b66a859f Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
6 * the documentation coming with IMIS-Labordaten-Application for details.
e440b66a859f Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
7 */
e440b66a859f Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
8
893
07dfcdf5b41f jsduck for grids and panels
Dustin Demuth <dustin@intevation.de>
parents: 845
diff changeset
9 /**
590
e440b66a859f Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
10 * Grid to list Messwerte
e440b66a859f Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
11 */
e440b66a859f Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
12 Ext.define('Lada.view.grid.Messwert', {
e440b66a859f Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
13 extend: 'Ext.grid.Panel',
e440b66a859f Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
14 alias: 'widget.messwertgrid',
e440b66a859f Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
15
e440b66a859f Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
16 requires: [
1119
b73f9a976c82 Exponential notation without tampering numbers.
Tom Gottfried <tom@intevation.de>
parents: 1112
diff changeset
17 'Lada.view.form.ExpNumberField',
590
e440b66a859f Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
18 'Lada.view.widget.Messgroesse',
e440b66a859f Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
19 'Lada.view.widget.Messeinheit'
e440b66a859f Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
20 ],
e440b66a859f Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
21
e440b66a859f Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
22 maxHeight: 350,
e440b66a859f Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
23 emptyText: 'Keine Messwerte gefunden.',
e440b66a859f Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
24 minHeight: 110,
e440b66a859f Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
25 viewConfig: {
e440b66a859f Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
26 deferEmptyText: false
e440b66a859f Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
27 },
e440b66a859f Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
28 margin: '0, 5, 5, 5',
e440b66a859f Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
29
e440b66a859f Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
30 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: 740
diff changeset
31 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: 740
diff changeset
32 allowDeselect: true,
845
613ad3263e59 Load messgroessen with messmethode filter.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 824
diff changeset
33 messgroesseStore: null,
1112
e76551a6da27 Use custom row expander in messung list grid.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1054
diff changeset
34 bottomBar: true,
590
e440b66a859f Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
35
e440b66a859f Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
36 initComponent: function() {
e440b66a859f Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
37 this.rowEditing = Ext.create('Ext.grid.plugin.RowEditing', {
e440b66a859f Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
38 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: 662
diff changeset
39 autoCancel: false,
703
9ab7b1eed9f8 Rowediting is now disabled when the Grid was set to ReadOnly
Dustin Demuth <dustin@intevation.de>
parents: 687
diff changeset
40 disabled: false,
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
41 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: 662
diff changeset
42 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: 662
diff changeset
43 // 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: 662
diff changeset
44 // 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: 687
diff changeset
45 // 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: 662
diff changeset
46 beforeedit: function(e, o) {
1112
e76551a6da27 Use custom row expander in messung list grid.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1054
diff changeset
47 // We are not in a messung window!
e76551a6da27 Use custom row expander in messung list grid.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1054
diff changeset
48 if (!o.grid.up('window')) {
e76551a6da27 Use custom row expander in messung list grid.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1054
diff changeset
49 return false;
e76551a6da27 Use custom row expander in messung list grid.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1054
diff changeset
50 }
e76551a6da27 Use custom row expander in messung list grid.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1054
diff changeset
51 // We are in a messung window and should check if we can
e76551a6da27 Use custom row expander in messung list grid.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1054
diff changeset
52 // edit.
703
9ab7b1eed9f8 Rowediting is now disabled when the Grid was set to ReadOnly
Dustin Demuth <dustin@intevation.de>
parents: 687
diff changeset
53 var readonlywin = o.grid.up('window').record.get('readonly');
9ab7b1eed9f8 Rowediting is now disabled when the Grid was set to ReadOnly
Dustin Demuth <dustin@intevation.de>
parents: 687
diff changeset
54 var readonlygrid = o.record.get('readonly');
9ab7b1eed9f8 Rowediting is now disabled when the Grid was set to ReadOnly
Dustin Demuth <dustin@intevation.de>
parents: 687
diff changeset
55 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: 662
diff changeset
56 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: 662
diff changeset
57 }
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: 662
diff changeset
58 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: 662
diff changeset
59 }
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: 662
diff changeset
60 }
845
613ad3263e59 Load messgroessen with messmethode filter.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 824
diff changeset
61 });
613ad3263e59 Load messgroessen with messmethode filter.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 824
diff changeset
62 var me = this;
590
e440b66a859f Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
63 this.plugins = [this.rowEditing];
e440b66a859f Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
64
e440b66a859f Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
65 this.dockedItems = [{
e440b66a859f Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
66 xtype: 'toolbar',
e440b66a859f Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
67 dock: 'bottom',
e440b66a859f Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
68 items: ['->', {
e440b66a859f Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
69 text: 'Hinzufügen',
e440b66a859f Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
70 icon: 'resources/img/list-add.png',
e440b66a859f Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
71 action: 'add',
e440b66a859f Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
72 probeId: this.probeId,
e440b66a859f Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
73 parentId: this.parentId
e440b66a859f Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
74 }, {
e440b66a859f Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
75 text: 'Löschen',
e440b66a859f Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
76 icon: 'resources/img/list-remove.png',
e440b66a859f Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
77 action: 'delete'
e440b66a859f Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
78 }]
e440b66a859f Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
79 }];
e440b66a859f Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
80 this.columns = [{
e440b66a859f Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
81 header: 'Messgröße',
e440b66a859f Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
82 dataIndex: 'messgroesseId',
e440b66a859f Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
83 width: 80,
e440b66a859f Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
84 renderer: function(value) {
e440b66a859f Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
85 if (!value || value === '') {
e440b66a859f Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
86 return '';
e440b66a859f Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
87 }
e440b66a859f Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
88 var store = Ext.data.StoreManager.get('messgroessen');
736
7ae9599bee39 Returned Units od Measurement where not distinct
Dustin Demuth <dustin@intevation.de>
parents: 718
diff changeset
89 return store.findRecord('id', value, 0, false, false, true).get('messgroesse');
590
e440b66a859f Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
90 },
e440b66a859f Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
91 editor: {
e440b66a859f Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
92 xtype: 'combobox',
845
613ad3263e59 Load messgroessen with messmethode filter.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 824
diff changeset
93 store: me.messgroesseStore,
590
e440b66a859f Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
94 displayField: 'messgroesse',
e440b66a859f Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
95 valueField: 'id',
662
7ede89336dbe MaxLength
Dustin Demuth <dustin@intevation.de>
parents: 624
diff changeset
96 allowBlank: false,
739
efb1369a8cac Enabled autocompletion for Messwerte in a Messung.
Dustin Demuth <dustin@intevation.de>
parents: 736
diff changeset
97 editable: true,
efb1369a8cac Enabled autocompletion for Messwerte in a Messung.
Dustin Demuth <dustin@intevation.de>
parents: 736
diff changeset
98 forceSelection: true,
efb1369a8cac Enabled autocompletion for Messwerte in a Messung.
Dustin Demuth <dustin@intevation.de>
parents: 736
diff changeset
99 autoSelect: true,
efb1369a8cac Enabled autocompletion for Messwerte in a Messung.
Dustin Demuth <dustin@intevation.de>
parents: 736
diff changeset
100 queryMode: 'local',
efb1369a8cac Enabled autocompletion for Messwerte in a Messung.
Dustin Demuth <dustin@intevation.de>
parents: 736
diff changeset
101 minChars: 0,
efb1369a8cac Enabled autocompletion for Messwerte in a Messung.
Dustin Demuth <dustin@intevation.de>
parents: 736
diff changeset
102 typeAhead: false,
efb1369a8cac Enabled autocompletion for Messwerte in a Messung.
Dustin Demuth <dustin@intevation.de>
parents: 736
diff changeset
103 triggerAction: 'all'
590
e440b66a859f Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
104 }
e440b66a859f Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
105 }, {
991
19b78162e128 reorg mewwert grid
Michael Stanko <mstanko@bfs.de>
parents: 893
diff changeset
106 header: '&lt;NWG',
19b78162e128 reorg mewwert grid
Michael Stanko <mstanko@bfs.de>
parents: 893
diff changeset
107 width: 60,
19b78162e128 reorg mewwert grid
Michael Stanko <mstanko@bfs.de>
parents: 893
diff changeset
108 dataIndex: 'messwertNwg',
19b78162e128 reorg mewwert grid
Michael Stanko <mstanko@bfs.de>
parents: 893
diff changeset
109 editor: {
993
f9449df5f9fb init messwertNwg for editing
Michael Stanko <mstanko@bfs.de>
parents: 991
diff changeset
110 xtype: 'checkbox',
1054
7e801af49eeb Use exponential notation for messwerte and zusatzwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 993
diff changeset
111 inputValue: '<'
991
19b78162e128 reorg mewwert grid
Michael Stanko <mstanko@bfs.de>
parents: 893
diff changeset
112 }
19b78162e128 reorg mewwert grid
Michael Stanko <mstanko@bfs.de>
parents: 893
diff changeset
113 }, {
590
e440b66a859f Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
114 header: 'Messwert',
e440b66a859f Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
115 dataIndex: 'messwert',
e440b66a859f Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
116 width: 80,
e440b66a859f Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
117 editor: {
1119
b73f9a976c82 Exponential notation without tampering numbers.
Tom Gottfried <tom@intevation.de>
parents: 1112
diff changeset
118 xtype: 'expnumberfield',
662
7ede89336dbe MaxLength
Dustin Demuth <dustin@intevation.de>
parents: 624
diff changeset
119 allowBlank: false,
1119
b73f9a976c82 Exponential notation without tampering numbers.
Tom Gottfried <tom@intevation.de>
parents: 1112
diff changeset
120 },
b73f9a976c82 Exponential notation without tampering numbers.
Tom Gottfried <tom@intevation.de>
parents: 1112
diff changeset
121 renderer: function(value) {
1123
4f68511ce7a4 Restrict range of values to two-digit exponent and format it nicely.
Tom Gottfried <tom@intevation.de>
parents: 1119
diff changeset
122 if (!value || value === '') {
4f68511ce7a4 Restrict range of values to two-digit exponent and format it nicely.
Tom Gottfried <tom@intevation.de>
parents: 1119
diff changeset
123 return value;
4f68511ce7a4 Restrict range of values to two-digit exponent and format it nicely.
Tom Gottfried <tom@intevation.de>
parents: 1119
diff changeset
124 }
4f68511ce7a4 Restrict range of values to two-digit exponent and format it nicely.
Tom Gottfried <tom@intevation.de>
parents: 1119
diff changeset
125 var strValue = value.toExponential(2).toString()
4f68511ce7a4 Restrict range of values to two-digit exponent and format it nicely.
Tom Gottfried <tom@intevation.de>
parents: 1119
diff changeset
126 .replace('.', Ext.util.Format.decimalSeparator);
4f68511ce7a4 Restrict range of values to two-digit exponent and format it nicely.
Tom Gottfried <tom@intevation.de>
parents: 1119
diff changeset
127 var splitted = strValue.split('e');
4f68511ce7a4 Restrict range of values to two-digit exponent and format it nicely.
Tom Gottfried <tom@intevation.de>
parents: 1119
diff changeset
128 var exponent = parseInt(splitted[1]);
4f68511ce7a4 Restrict range of values to two-digit exponent and format it nicely.
Tom Gottfried <tom@intevation.de>
parents: 1119
diff changeset
129 return splitted[0] + 'e'
4f68511ce7a4 Restrict range of values to two-digit exponent and format it nicely.
Tom Gottfried <tom@intevation.de>
parents: 1119
diff changeset
130 + ((exponent < 0) ? '-' : '+')
4f68511ce7a4 Restrict range of values to two-digit exponent and format it nicely.
Tom Gottfried <tom@intevation.de>
parents: 1119
diff changeset
131 + ((Math.abs(exponent) < 10) ? '0' : '')
4f68511ce7a4 Restrict range of values to two-digit exponent and format it nicely.
Tom Gottfried <tom@intevation.de>
parents: 1119
diff changeset
132 + Math.abs(exponent).toString();
590
e440b66a859f Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
133 }
e440b66a859f Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
134 }, {
e440b66a859f Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
135 header: 'Messeinheit',
e440b66a859f Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
136 dataIndex: 'mehId',
e440b66a859f Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
137 width: 90,
e440b66a859f Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
138 renderer: function(value) {
e440b66a859f Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
139 if (!value || value === '') {
e440b66a859f Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
140 return '';
e440b66a859f Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
141 }
e440b66a859f Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
142 var store = Ext.data.StoreManager.get('messeinheiten');
736
7ae9599bee39 Returned Units od Measurement where not distinct
Dustin Demuth <dustin@intevation.de>
parents: 718
diff changeset
143 return store.findRecord('id', value, 0, false, false, true).get('einheit');
590
e440b66a859f Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
144 },
e440b66a859f Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
145 editor: {
e440b66a859f Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
146 xtype: 'combobox',
e440b66a859f Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
147 store: Ext.data.StoreManager.get('messeinheiten'),
e440b66a859f Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
148 displayField: 'einheit',
e440b66a859f Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
149 valueField: 'id',
662
7ede89336dbe MaxLength
Dustin Demuth <dustin@intevation.de>
parents: 624
diff changeset
150 allowBlank: false,
740
2e8da590ea0c made Comboboces editable and filterable for; Messungenform: Messstelle,Datenbasis,Betriebsarts,Testdatensatz,Preobenart,Netzbetreiber Messungform: Messmethode Messwertegrid: Messgroesse,Messeinheit
Dustin Demuth <dustin@intevation.de>
parents: 739
diff changeset
151 editable: true,
2e8da590ea0c made Comboboces editable and filterable for; Messungenform: Messstelle,Datenbasis,Betriebsarts,Testdatensatz,Preobenart,Netzbetreiber Messungform: Messmethode Messwertegrid: Messgroesse,Messeinheit
Dustin Demuth <dustin@intevation.de>
parents: 739
diff changeset
152 forceSelection: true,
2e8da590ea0c made Comboboces editable and filterable for; Messungenform: Messstelle,Datenbasis,Betriebsarts,Testdatensatz,Preobenart,Netzbetreiber Messungform: Messmethode Messwertegrid: Messgroesse,Messeinheit
Dustin Demuth <dustin@intevation.de>
parents: 739
diff changeset
153 autoSelect: true,
2e8da590ea0c made Comboboces editable and filterable for; Messungenform: Messstelle,Datenbasis,Betriebsarts,Testdatensatz,Preobenart,Netzbetreiber Messungform: Messmethode Messwertegrid: Messgroesse,Messeinheit
Dustin Demuth <dustin@intevation.de>
parents: 739
diff changeset
154 queryMode: 'local',
2e8da590ea0c made Comboboces editable and filterable for; Messungenform: Messstelle,Datenbasis,Betriebsarts,Testdatensatz,Preobenart,Netzbetreiber Messungform: Messmethode Messwertegrid: Messgroesse,Messeinheit
Dustin Demuth <dustin@intevation.de>
parents: 739
diff changeset
155 minChars: 0,
2e8da590ea0c made Comboboces editable and filterable for; Messungenform: Messstelle,Datenbasis,Betriebsarts,Testdatensatz,Preobenart,Netzbetreiber Messungform: Messmethode Messwertegrid: Messgroesse,Messeinheit
Dustin Demuth <dustin@intevation.de>
parents: 739
diff changeset
156 typeAhead: false,
2e8da590ea0c made Comboboces editable and filterable for; Messungenform: Messstelle,Datenbasis,Betriebsarts,Testdatensatz,Preobenart,Netzbetreiber Messungform: Messmethode Messwertegrid: Messgroesse,Messeinheit
Dustin Demuth <dustin@intevation.de>
parents: 739
diff changeset
157 triggerAction: 'all'
590
e440b66a859f Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
158 }
e440b66a859f Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
159 }, {
e440b66a859f Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
160 header: 'Messfehler',
e440b66a859f Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
161 dataIndex: 'messfehler',
624
927484545e9b added xtype for numeric-fields to grid to enable decimalseparator-replacement by locale-config
Dustin Demuth <dustin@intevation.de>
parents: 591
diff changeset
162 xtype: 'numbercolumn',
590
e440b66a859f Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
163 width: 80,
e440b66a859f Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
164 editor: {
e440b66a859f Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
165 xtype: 'numberfield',
662
7ede89336dbe MaxLength
Dustin Demuth <dustin@intevation.de>
parents: 624
diff changeset
166 allowBlank: false,
7ede89336dbe MaxLength
Dustin Demuth <dustin@intevation.de>
parents: 624
diff changeset
167 maxLength: 10,
7ede89336dbe MaxLength
Dustin Demuth <dustin@intevation.de>
parents: 624
diff changeset
168 allowExponential: false,
718
7f11b75e0188 Trailing Commas, editable: false for Umwelt und Messstelle widget
Dustin Demuth <dustin@intevation.de>
parents: 703
diff changeset
169 enforceMaxLength: true
590
e440b66a859f Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
170 }
e440b66a859f Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
171 }, {
991
19b78162e128 reorg mewwert grid
Michael Stanko <mstanko@bfs.de>
parents: 893
diff changeset
172 header: 'Nachweisgrenze',
19b78162e128 reorg mewwert grid
Michael Stanko <mstanko@bfs.de>
parents: 893
diff changeset
173 dataIndex: 'nwgZuMesswert',
19b78162e128 reorg mewwert grid
Michael Stanko <mstanko@bfs.de>
parents: 893
diff changeset
174 width: 80,
19b78162e128 reorg mewwert grid
Michael Stanko <mstanko@bfs.de>
parents: 893
diff changeset
175 editor: {
1123
4f68511ce7a4 Restrict range of values to two-digit exponent and format it nicely.
Tom Gottfried <tom@intevation.de>
parents: 1119
diff changeset
176 xtype: 'expnumberfield',
1119
b73f9a976c82 Exponential notation without tampering numbers.
Tom Gottfried <tom@intevation.de>
parents: 1112
diff changeset
177 },
b73f9a976c82 Exponential notation without tampering numbers.
Tom Gottfried <tom@intevation.de>
parents: 1112
diff changeset
178 renderer: function(value) {
b73f9a976c82 Exponential notation without tampering numbers.
Tom Gottfried <tom@intevation.de>
parents: 1112
diff changeset
179 if (!value || value === '') {
b73f9a976c82 Exponential notation without tampering numbers.
Tom Gottfried <tom@intevation.de>
parents: 1112
diff changeset
180 return value;
b73f9a976c82 Exponential notation without tampering numbers.
Tom Gottfried <tom@intevation.de>
parents: 1112
diff changeset
181 }
1123
4f68511ce7a4 Restrict range of values to two-digit exponent and format it nicely.
Tom Gottfried <tom@intevation.de>
parents: 1119
diff changeset
182 var strValue = value.toExponential(2).toString()
4f68511ce7a4 Restrict range of values to two-digit exponent and format it nicely.
Tom Gottfried <tom@intevation.de>
parents: 1119
diff changeset
183 .replace('.', Ext.util.Format.decimalSeparator);
4f68511ce7a4 Restrict range of values to two-digit exponent and format it nicely.
Tom Gottfried <tom@intevation.de>
parents: 1119
diff changeset
184 var splitted = strValue.split('e');
4f68511ce7a4 Restrict range of values to two-digit exponent and format it nicely.
Tom Gottfried <tom@intevation.de>
parents: 1119
diff changeset
185 var exponent = parseInt(splitted[1]);
4f68511ce7a4 Restrict range of values to two-digit exponent and format it nicely.
Tom Gottfried <tom@intevation.de>
parents: 1119
diff changeset
186 return splitted[0] + 'e'
4f68511ce7a4 Restrict range of values to two-digit exponent and format it nicely.
Tom Gottfried <tom@intevation.de>
parents: 1119
diff changeset
187 + ((exponent < 0) ? '-' : '+')
4f68511ce7a4 Restrict range of values to two-digit exponent and format it nicely.
Tom Gottfried <tom@intevation.de>
parents: 1119
diff changeset
188 + ((Math.abs(exponent) < 10) ? '0' : '')
4f68511ce7a4 Restrict range of values to two-digit exponent and format it nicely.
Tom Gottfried <tom@intevation.de>
parents: 1119
diff changeset
189 + Math.abs(exponent).toString();
991
19b78162e128 reorg mewwert grid
Michael Stanko <mstanko@bfs.de>
parents: 893
diff changeset
190 }
19b78162e128 reorg mewwert grid
Michael Stanko <mstanko@bfs.de>
parents: 893
diff changeset
191 }, {
590
e440b66a859f Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
192 header: 'Grenzwertüberschreitung',
e440b66a859f Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
193 dataIndex: 'grenzwertueberschreitung',
e440b66a859f Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
194 flex: 1,
e440b66a859f Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
195 renderer: function(value) {
e440b66a859f Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
196 if (value === true) {
e440b66a859f Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
197 return 'Ja';
e440b66a859f Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
198 }
e440b66a859f Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
199 return 'Nein';
e440b66a859f Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
200 },
e440b66a859f Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
201 editor: {
e440b66a859f Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
202 xtype: 'checkbox'
e440b66a859f Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
203 }
e440b66a859f Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
204 }];
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: 740
diff changeset
205 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: 740
diff changeset
206 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: 740
diff changeset
207 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: 740
diff changeset
208 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: 740
diff changeset
209 },
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: 740
diff changeset
210 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: 740
diff changeset
211 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: 740
diff changeset
212 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: 740
diff changeset
213 }
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: 740
diff changeset
214 };
590
e440b66a859f Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
215 this.initData();
e440b66a859f Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
216 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: 740
diff changeset
217 this.setReadOnly(true); //Grid is always initialised as RO
1112
e76551a6da27 Use custom row expander in messung list grid.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1054
diff changeset
218 if (!me.bottomBar) {
e76551a6da27 Use custom row expander in messung list grid.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1054
diff changeset
219 this.down('toolbar[dock=bottom]').hide();
e76551a6da27 Use custom row expander in messung list grid.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1054
diff changeset
220 }
590
e440b66a859f Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
221 },
e440b66a859f Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
222
e440b66a859f Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
223 initData: function() {
e440b66a859f Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
224 if (this.store) {
e440b66a859f Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
225 this.store.removeAll();
e440b66a859f Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
226 }
e440b66a859f Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
227 else {
e440b66a859f Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
228 this.store = Ext.create('Lada.store.Messwerte');
e440b66a859f Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
229 }
e440b66a859f Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
230 this.store.load({
e440b66a859f Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
231 params: {
e440b66a859f Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
232 messungsId: this.recordId
e440b66a859f Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
233 }
e440b66a859f Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
234 });
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
235 },
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
236
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
237 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
238 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
239 //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
240 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
241 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
242 }
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
243 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
244 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
245 }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
246 //Writable
687
aedf0709af92 Applied ReadOnlyParadigm to a Messung Window
Dustin Demuth <dustin@intevation.de>
parents: 684
diff changeset
247 if (this.getPlugin('rowedit')){
aedf0709af92 Applied ReadOnlyParadigm to a Messung Window
Dustin Demuth <dustin@intevation.de>
parents: 684
diff changeset
248 this.getPlugin('rowedit').enable();
aedf0709af92 Applied ReadOnlyParadigm to a Messung Window
Dustin Demuth <dustin@intevation.de>
parents: 684
diff changeset
249 }
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: 740
diff changeset
250 //this.down('button[action=delete]').enable();
687
aedf0709af92 Applied ReadOnlyParadigm to a Messung Window
Dustin Demuth <dustin@intevation.de>
parents: 684
diff changeset
251 this.down('button[action=add]').enable();
aedf0709af92 Applied ReadOnlyParadigm to a Messung Window
Dustin Demuth <dustin@intevation.de>
parents: 684
diff changeset
252 }
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: 740
diff changeset
253 },
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: 740
diff changeset
254 /**
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: 740
diff changeset
255 * Activate the Remove Button
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: 740
diff changeset
256 */
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: 740
diff changeset
257 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: 740
diff changeset
258 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: 740
diff changeset
259 //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: 740
diff changeset
260 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: 740
diff changeset
261 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: 740
diff changeset
262 }
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: 740
diff changeset
263 },
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: 740
diff changeset
264 /**
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: 740
diff changeset
265 * Activate the Remove Button
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: 740
diff changeset
266 */
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: 740
diff changeset
267 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: 740
diff changeset
268 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: 740
diff changeset
269 //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: 740
diff changeset
270 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: 740
diff changeset
271 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: 740
diff changeset
272 }
590
e440b66a859f Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
273 }
e440b66a859f Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
274 });

http://lada.wald.intevation.org