annotate app/view/grid/Messwert.js @ 701:f0bc5387abcc

Added failure - Messages
author Dustin Demuth <dustin@intevation.de>
date Fri, 27 Mar 2015 09:38:13 +0100
parents aedf0709af92
children 9ab7b1eed9f8
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
e440b66a859f Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
9 /*
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,
e440b66a859f Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
30
e440b66a859f Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
31 initComponent: function() {
e440b66a859f Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
32 this.rowEditing = Ext.create('Ext.grid.plugin.RowEditing', {
e440b66a859f Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
33 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
34 autoCancel: 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
35 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
36 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
37 // 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
38 // Normally this would belong into a controller an not the view.
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 beforeedit: function(e, o) {
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 if (o.record.get('readonly') == 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
41 return false;
612f4f933083 Made Grid-Rows uneditable if the dataset contains readonly=true. This only affects the Grids using the RowEdit Plugin
Dustin Demuth <dustin@intevation.de>
parents: 662
diff changeset
42 }
612f4f933083 Made Grid-Rows uneditable if the dataset contains readonly=true. This only affects the Grids using the RowEdit Plugin
Dustin Demuth <dustin@intevation.de>
parents: 662
diff changeset
43 return true;
612f4f933083 Made Grid-Rows uneditable if the dataset contains readonly=true. This only affects the Grids using the RowEdit Plugin
Dustin Demuth <dustin@intevation.de>
parents: 662
diff changeset
44 }
612f4f933083 Made Grid-Rows uneditable if the dataset contains readonly=true. This only affects the Grids using the RowEdit Plugin
Dustin Demuth <dustin@intevation.de>
parents: 662
diff changeset
45 }
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 });
590
e440b66a859f Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
47
e440b66a859f Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
48 this.plugins = [this.rowEditing];
e440b66a859f Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
49
e440b66a859f Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
50 this.dockedItems = [{
e440b66a859f Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
51 xtype: 'toolbar',
e440b66a859f Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
52 dock: 'bottom',
e440b66a859f Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
53 items: ['->', {
e440b66a859f Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
54 text: 'Hinzufügen',
e440b66a859f Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
55 icon: 'resources/img/list-add.png',
e440b66a859f Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
56 action: 'add',
e440b66a859f Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
57 probeId: this.probeId,
e440b66a859f Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
58 parentId: this.parentId
e440b66a859f Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
59 }, {
e440b66a859f Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
60 text: 'Löschen',
e440b66a859f Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
61 icon: 'resources/img/list-remove.png',
e440b66a859f Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
62 action: 'delete'
e440b66a859f Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
63 }]
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.columns = [{
e440b66a859f Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
66 header: 'Messgröße',
e440b66a859f Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
67 dataIndex: 'messgroesseId',
e440b66a859f Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
68 width: 80,
e440b66a859f Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
69 renderer: function(value) {
e440b66a859f Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
70 if (!value || value === '') {
e440b66a859f Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
71 return '';
e440b66a859f Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
72 }
e440b66a859f Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
73 var store = Ext.data.StoreManager.get('messgroessen');
e440b66a859f Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
74 return store.findRecord('id', value).get('messgroesse');
e440b66a859f Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
75 },
e440b66a859f Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
76 editor: {
e440b66a859f Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
77 xtype: 'combobox',
e440b66a859f Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
78 store: Ext.data.StoreManager.get('messgroessen'),
e440b66a859f Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
79 displayField: 'messgroesse',
e440b66a859f Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
80 valueField: 'id',
662
7ede89336dbe MaxLength
Dustin Demuth <dustin@intevation.de>
parents: 624
diff changeset
81 allowBlank: false,
7ede89336dbe MaxLength
Dustin Demuth <dustin@intevation.de>
parents: 624
diff changeset
82 editable: false
590
e440b66a859f Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
83 }
e440b66a859f Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
84 }, {
e440b66a859f Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
85 header: 'Messwert',
e440b66a859f Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
86 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
87 xtype: 'numbercolumn',
590
e440b66a859f Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
88 width: 80,
e440b66a859f Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
89 editor: {
e440b66a859f Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
90 xtype: 'numberfield',
662
7ede89336dbe MaxLength
Dustin Demuth <dustin@intevation.de>
parents: 624
diff changeset
91 allowBlank: false,
7ede89336dbe MaxLength
Dustin Demuth <dustin@intevation.de>
parents: 624
diff changeset
92 maxLength: 10,
7ede89336dbe MaxLength
Dustin Demuth <dustin@intevation.de>
parents: 624
diff changeset
93 allowExponential: false,
7ede89336dbe MaxLength
Dustin Demuth <dustin@intevation.de>
parents: 624
diff changeset
94 enforceMaxLength: true,
590
e440b66a859f Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
95 }
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 header: 'Messeinheit',
e440b66a859f Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
98 dataIndex: 'mehId',
e440b66a859f Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
99 width: 90,
e440b66a859f Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
100 renderer: function(value) {
e440b66a859f Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
101 if (!value || value === '') {
e440b66a859f Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
102 return '';
e440b66a859f Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
103 }
e440b66a859f Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
104 var store = Ext.data.StoreManager.get('messeinheiten');
e440b66a859f Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
105 return store.findRecord('id', value).get('einheit');
e440b66a859f Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
106 },
e440b66a859f Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
107 editor: {
e440b66a859f Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
108 xtype: 'combobox',
e440b66a859f Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
109 store: Ext.data.StoreManager.get('messeinheiten'),
e440b66a859f Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
110 displayField: 'einheit',
e440b66a859f Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
111 valueField: 'id',
662
7ede89336dbe MaxLength
Dustin Demuth <dustin@intevation.de>
parents: 624
diff changeset
112 allowBlank: false,
7ede89336dbe MaxLength
Dustin Demuth <dustin@intevation.de>
parents: 624
diff changeset
113 editable: false
590
e440b66a859f Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
114 }
e440b66a859f Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
115 }, {
e440b66a859f Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
116 header: '&lt;NWG',
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
117 xtype: 'numbercolumn',
590
e440b66a859f Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
118 width: 60,
e440b66a859f Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
119 dataIndex: 'messwertNwg'
e440b66a859f Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
120 }, {
e440b66a859f Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
121 header: 'Nachweisgrenze',
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
122 xtype: 'numbercolumn',
590
e440b66a859f Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
123 width: 110,
e440b66a859f Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
124 dataIndex: 'nwgZuMesswert'
e440b66a859f Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
125 }, {
e440b66a859f Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
126 header: 'Messfehler',
e440b66a859f Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
127 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
128 xtype: 'numbercolumn',
590
e440b66a859f Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
129 width: 80,
e440b66a859f Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
130 editor: {
e440b66a859f Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
131 xtype: 'numberfield',
662
7ede89336dbe MaxLength
Dustin Demuth <dustin@intevation.de>
parents: 624
diff changeset
132 allowBlank: false,
7ede89336dbe MaxLength
Dustin Demuth <dustin@intevation.de>
parents: 624
diff changeset
133 maxLength: 10,
7ede89336dbe MaxLength
Dustin Demuth <dustin@intevation.de>
parents: 624
diff changeset
134 allowExponential: false,
7ede89336dbe MaxLength
Dustin Demuth <dustin@intevation.de>
parents: 624
diff changeset
135 enforceMaxLength: true,
590
e440b66a859f Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
136 }
e440b66a859f Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
137 }, {
e440b66a859f Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
138 header: 'Grenzwertüberschreitung',
e440b66a859f Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
139 dataIndex: 'grenzwertueberschreitung',
e440b66a859f Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
140 flex: 1,
e440b66a859f Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
141 renderer: function(value) {
e440b66a859f Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
142 if (value === true) {
e440b66a859f Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
143 return 'Ja';
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 return 'Nein';
e440b66a859f Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
146 },
e440b66a859f Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
147 editor: {
e440b66a859f Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
148 xtype: 'checkbox'
e440b66a859f Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
149 }
e440b66a859f Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
150 }];
e440b66a859f Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
151 this.initData();
e440b66a859f Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
152 this.callParent(arguments);
e440b66a859f Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
153 },
e440b66a859f Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
154
e440b66a859f Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
155 initData: function() {
e440b66a859f Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
156 if (this.store) {
e440b66a859f Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
157 this.store.removeAll();
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 else {
e440b66a859f Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
160 this.store = Ext.create('Lada.store.Messwerte');
e440b66a859f Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
161 }
e440b66a859f Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
162 this.store.load({
e440b66a859f Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
163 params: {
e440b66a859f Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
164 messungsId: this.recordId
e440b66a859f Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
165 }
e440b66a859f Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
166 });
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
167 },
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
168
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
169 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
170 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
171 //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
172 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
173 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
174 }
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
175 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
176 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
177 }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
178 //Writable
687
aedf0709af92 Applied ReadOnlyParadigm to a Messung Window
Dustin Demuth <dustin@intevation.de>
parents: 684
diff changeset
179 if (this.getPlugin('rowedit')){
aedf0709af92 Applied ReadOnlyParadigm to a Messung Window
Dustin Demuth <dustin@intevation.de>
parents: 684
diff changeset
180 this.getPlugin('rowedit').enable();
aedf0709af92 Applied ReadOnlyParadigm to a Messung Window
Dustin Demuth <dustin@intevation.de>
parents: 684
diff changeset
181 }
aedf0709af92 Applied ReadOnlyParadigm to a Messung Window
Dustin Demuth <dustin@intevation.de>
parents: 684
diff changeset
182 this.down('button[action=delete]').enable();
aedf0709af92 Applied ReadOnlyParadigm to a Messung Window
Dustin Demuth <dustin@intevation.de>
parents: 684
diff changeset
183 this.down('button[action=add]').enable();
aedf0709af92 Applied ReadOnlyParadigm to a Messung Window
Dustin Demuth <dustin@intevation.de>
parents: 684
diff changeset
184 }
590
e440b66a859f Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
185 }
e440b66a859f Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
186 });

http://lada.wald.intevation.org