Mercurial > lada > lada-client
annotate app/view/grid/Messwert.js @ 1024:181621463d01
Less misleading error message.
author | Tom Gottfried <tom@intevation.de> |
---|---|
date | Thu, 11 Feb 2016 12:10:53 +0100 |
parents | f9449df5f9fb |
children | 7e801af49eeb |
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: [ |
e440b66a859f
Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
17 'Lada.view.widget.Messgroesse', |
e440b66a859f
Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
18 'Lada.view.widget.Messeinheit' |
e440b66a859f
Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
19 ], |
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 maxHeight: 350, |
e440b66a859f
Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
22 emptyText: 'Keine Messwerte gefunden.', |
e440b66a859f
Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
23 minHeight: 110, |
e440b66a859f
Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
24 viewConfig: { |
e440b66a859f
Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
25 deferEmptyText: false |
e440b66a859f
Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
26 }, |
e440b66a859f
Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
27 margin: '0, 5, 5, 5', |
e440b66a859f
Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
28 |
e440b66a859f
Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
29 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
|
30 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
|
31 allowDeselect: true, |
845
613ad3263e59
Load messgroessen with messmethode filter.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
824
diff
changeset
|
32 messgroesseStore: null, |
590
e440b66a859f
Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
33 |
e440b66a859f
Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
34 initComponent: function() { |
e440b66a859f
Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
35 this.rowEditing = Ext.create('Ext.grid.plugin.RowEditing', { |
e440b66a859f
Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
36 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
|
37 autoCancel: false, |
703
9ab7b1eed9f8
Rowediting is now disabled when the Grid was set to ReadOnly
Dustin Demuth <dustin@intevation.de>
parents:
687
diff
changeset
|
38 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
|
39 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
|
40 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
|
41 // 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
|
42 // 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
|
43 // 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
|
44 beforeedit: function(e, o) { |
703
9ab7b1eed9f8
Rowediting is now disabled when the Grid was set to ReadOnly
Dustin Demuth <dustin@intevation.de>
parents:
687
diff
changeset
|
45 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
|
46 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
|
47 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
|
48 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
|
49 } |
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
|
50 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
|
51 } |
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
|
52 } |
845
613ad3263e59
Load messgroessen with messmethode filter.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
824
diff
changeset
|
53 }); |
613ad3263e59
Load messgroessen with messmethode filter.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
824
diff
changeset
|
54 var me = this; |
590
e440b66a859f
Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
55 this.plugins = [this.rowEditing]; |
e440b66a859f
Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
56 |
e440b66a859f
Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
57 this.dockedItems = [{ |
e440b66a859f
Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
58 xtype: 'toolbar', |
e440b66a859f
Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
59 dock: 'bottom', |
e440b66a859f
Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
60 items: ['->', { |
e440b66a859f
Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
61 text: 'Hinzufügen', |
e440b66a859f
Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
62 icon: 'resources/img/list-add.png', |
e440b66a859f
Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
63 action: 'add', |
e440b66a859f
Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
64 probeId: this.probeId, |
e440b66a859f
Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
65 parentId: this.parentId |
e440b66a859f
Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
66 }, { |
e440b66a859f
Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
67 text: 'Löschen', |
e440b66a859f
Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
68 icon: 'resources/img/list-remove.png', |
e440b66a859f
Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
69 action: 'delete' |
e440b66a859f
Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
70 }] |
e440b66a859f
Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
71 }]; |
e440b66a859f
Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
72 this.columns = [{ |
e440b66a859f
Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
73 header: 'Messgröße', |
e440b66a859f
Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
74 dataIndex: 'messgroesseId', |
e440b66a859f
Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
75 width: 80, |
e440b66a859f
Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
76 renderer: function(value) { |
e440b66a859f
Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
77 if (!value || value === '') { |
e440b66a859f
Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
78 return ''; |
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 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
|
81 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
|
82 }, |
e440b66a859f
Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
83 editor: { |
e440b66a859f
Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
84 xtype: 'combobox', |
845
613ad3263e59
Load messgroessen with messmethode filter.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
824
diff
changeset
|
85 store: me.messgroesseStore, |
590
e440b66a859f
Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
86 displayField: 'messgroesse', |
e440b66a859f
Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
87 valueField: 'id', |
662 | 88 allowBlank: false, |
739
efb1369a8cac
Enabled autocompletion for Messwerte in a Messung.
Dustin Demuth <dustin@intevation.de>
parents:
736
diff
changeset
|
89 editable: true, |
efb1369a8cac
Enabled autocompletion for Messwerte in a Messung.
Dustin Demuth <dustin@intevation.de>
parents:
736
diff
changeset
|
90 forceSelection: true, |
efb1369a8cac
Enabled autocompletion for Messwerte in a Messung.
Dustin Demuth <dustin@intevation.de>
parents:
736
diff
changeset
|
91 autoSelect: true, |
efb1369a8cac
Enabled autocompletion for Messwerte in a Messung.
Dustin Demuth <dustin@intevation.de>
parents:
736
diff
changeset
|
92 queryMode: 'local', |
efb1369a8cac
Enabled autocompletion for Messwerte in a Messung.
Dustin Demuth <dustin@intevation.de>
parents:
736
diff
changeset
|
93 minChars: 0, |
efb1369a8cac
Enabled autocompletion for Messwerte in a Messung.
Dustin Demuth <dustin@intevation.de>
parents:
736
diff
changeset
|
94 typeAhead: false, |
efb1369a8cac
Enabled autocompletion for Messwerte in a Messung.
Dustin Demuth <dustin@intevation.de>
parents:
736
diff
changeset
|
95 triggerAction: 'all' |
590
e440b66a859f
Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
96 } |
e440b66a859f
Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
97 }, { |
991 | 98 header: '<NWG', |
99 width: 60, | |
100 dataIndex: 'messwertNwg', | |
101 editor: { | |
993
f9449df5f9fb
init messwertNwg for editing
Michael Stanko <mstanko@bfs.de>
parents:
991
diff
changeset
|
102 xtype: 'checkbox', |
f9449df5f9fb
init messwertNwg for editing
Michael Stanko <mstanko@bfs.de>
parents:
991
diff
changeset
|
103 inputValue: '<' |
991 | 104 } |
105 }, { | |
590
e440b66a859f
Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
106 header: 'Messwert', |
e440b66a859f
Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
107 dataIndex: 'messwert', |
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
|
108 xtype: 'numbercolumn', |
590
e440b66a859f
Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
109 width: 80, |
991 | 110 renderer: function(value) { |
993
f9449df5f9fb
init messwertNwg for editing
Michael Stanko <mstanko@bfs.de>
parents:
991
diff
changeset
|
111 return value.toExponential(2); |
991 | 112 }, |
590
e440b66a859f
Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
113 editor: { |
e440b66a859f
Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
114 xtype: 'numberfield', |
662 | 115 allowBlank: false, |
116 maxLength: 10, | |
991 | 117 allowExponential: true, |
118 enforceMaxLength: true, | |
119 hideTrigger: true, | |
120 keyNavEnabled: false, | |
121 mouseWheelEnabled: false | |
590
e440b66a859f
Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
122 } |
e440b66a859f
Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
123 }, { |
e440b66a859f
Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
124 header: 'Messeinheit', |
e440b66a859f
Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
125 dataIndex: 'mehId', |
e440b66a859f
Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
126 width: 90, |
e440b66a859f
Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
127 renderer: function(value) { |
e440b66a859f
Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
128 if (!value || value === '') { |
e440b66a859f
Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
129 return ''; |
e440b66a859f
Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
130 } |
e440b66a859f
Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
131 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
|
132 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
|
133 }, |
e440b66a859f
Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
134 editor: { |
e440b66a859f
Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
135 xtype: 'combobox', |
e440b66a859f
Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
136 store: Ext.data.StoreManager.get('messeinheiten'), |
e440b66a859f
Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
137 displayField: 'einheit', |
e440b66a859f
Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
138 valueField: 'id', |
662 | 139 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
|
140 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
|
141 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
|
142 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
|
143 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
|
144 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
|
145 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
|
146 triggerAction: 'all' |
590
e440b66a859f
Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
147 } |
e440b66a859f
Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
148 }, { |
e440b66a859f
Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
149 header: 'Messfehler', |
e440b66a859f
Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
150 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
|
151 xtype: 'numbercolumn', |
590
e440b66a859f
Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
152 width: 80, |
e440b66a859f
Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
153 editor: { |
e440b66a859f
Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
154 xtype: 'numberfield', |
662 | 155 allowBlank: false, |
156 maxLength: 10, | |
157 allowExponential: false, | |
718
7f11b75e0188
Trailing Commas, editable: false for Umwelt und Messstelle widget
Dustin Demuth <dustin@intevation.de>
parents:
703
diff
changeset
|
158 enforceMaxLength: true |
590
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 }, { |
991 | 161 header: 'Nachweisgrenze', |
162 xtype: 'numbercolumn', | |
163 dataIndex: 'nwgZuMesswert', | |
164 width: 80, | |
165 renderer: function(value) { | |
166 if (!value) { | |
167 return null; | |
168 } else { | |
993
f9449df5f9fb
init messwertNwg for editing
Michael Stanko <mstanko@bfs.de>
parents:
991
diff
changeset
|
169 return value.toExponential(2); |
991 | 170 } |
171 }, | |
172 editor: { | |
173 xtype: 'numberfield', | |
174 allowBlank: true, | |
175 maxLength: 10, | |
176 allowExponential: true, | |
177 enforceMaxLength: true, | |
178 hideTrigger: true, | |
179 keyNavEnabled: false, | |
180 mouseWheelEnabled: false | |
181 } | |
182 }, { | |
590
e440b66a859f
Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
183 header: 'Grenzwertüberschreitung', |
e440b66a859f
Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
184 dataIndex: 'grenzwertueberschreitung', |
e440b66a859f
Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
185 flex: 1, |
e440b66a859f
Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
186 renderer: function(value) { |
e440b66a859f
Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
187 if (value === true) { |
e440b66a859f
Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
188 return 'Ja'; |
e440b66a859f
Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
189 } |
e440b66a859f
Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
190 return 'Nein'; |
e440b66a859f
Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
191 }, |
e440b66a859f
Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
192 editor: { |
e440b66a859f
Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
193 xtype: 'checkbox' |
e440b66a859f
Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
194 } |
e440b66a859f
Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
195 }]; |
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
|
196 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
|
197 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
|
198 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
|
199 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
|
200 }, |
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
|
201 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
|
202 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
|
203 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
|
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:
740
diff
changeset
|
205 }; |
590
e440b66a859f
Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
206 this.initData(); |
e440b66a859f
Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
207 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
|
208 this.setReadOnly(true); //Grid is always initialised as RO |
590
e440b66a859f
Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
209 }, |
e440b66a859f
Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
210 |
e440b66a859f
Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
211 initData: function() { |
e440b66a859f
Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
212 if (this.store) { |
e440b66a859f
Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
213 this.store.removeAll(); |
e440b66a859f
Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
214 } |
e440b66a859f
Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
215 else { |
e440b66a859f
Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
216 this.store = Ext.create('Lada.store.Messwerte'); |
e440b66a859f
Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
217 } |
e440b66a859f
Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
218 this.store.load({ |
e440b66a859f
Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
219 params: { |
e440b66a859f
Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
220 messungsId: this.recordId |
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 }); |
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
|
223 }, |
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
|
224 |
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
|
225 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
|
226 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
|
227 //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
|
228 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
|
229 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
|
230 } |
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
|
231 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
|
232 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
|
233 }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
|
234 //Writable |
687
aedf0709af92
Applied ReadOnlyParadigm to a Messung Window
Dustin Demuth <dustin@intevation.de>
parents:
684
diff
changeset
|
235 if (this.getPlugin('rowedit')){ |
aedf0709af92
Applied ReadOnlyParadigm to a Messung Window
Dustin Demuth <dustin@intevation.de>
parents:
684
diff
changeset
|
236 this.getPlugin('rowedit').enable(); |
aedf0709af92
Applied ReadOnlyParadigm to a Messung Window
Dustin Demuth <dustin@intevation.de>
parents:
684
diff
changeset
|
237 } |
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
|
238 //this.down('button[action=delete]').enable(); |
687
aedf0709af92
Applied ReadOnlyParadigm to a Messung Window
Dustin Demuth <dustin@intevation.de>
parents:
684
diff
changeset
|
239 this.down('button[action=add]').enable(); |
aedf0709af92
Applied ReadOnlyParadigm to a Messung Window
Dustin Demuth <dustin@intevation.de>
parents:
684
diff
changeset
|
240 } |
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
|
241 }, |
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
|
242 /** |
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
|
243 * 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
|
244 */ |
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
|
245 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
|
246 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
|
247 //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
|
248 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
|
249 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
|
250 } |
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
|
251 }, |
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
|
252 /** |
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 * 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
|
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 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
|
256 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
|
257 //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
|
258 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
|
259 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
|
260 } |
590
e440b66a859f
Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
261 } |
e440b66a859f
Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
262 }); |