annotate app/view/grid/Probenzusatzwert.js @ 722:cf898d2cd362

Do not autoload this store
author Dustin Demuth <dustin@intevation.de>
date Thu, 16 Apr 2015 11:58:00 +0200
parents 7f11b75e0188
children 52c50a5f457b
rev   line source
548
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
1 /* Copyright (C) 2013 by Bundesamt fuer Strahlenschutz
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
2 * Software engineering by Intevation GmbH
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
3 *
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
4 * This file is Free Software under the GNU GPL (v>=3)
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
5 * and comes with ABSOLUTELY NO WARRANTY! Check out
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
6 * the documentation coming with IMIS-Labordaten-Application for details.
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
7 */
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
8
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
9 /*
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
10 * Grid to list Probenzusatzwerte
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
11 */
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
12 Ext.define('Lada.view.grid.Probenzusatzwert', {
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
13 extend: 'Ext.grid.Panel',
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
14 alias: 'widget.probenzusatzwertgrid',
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
15 requires: [
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
16 'Lada.view.widget.Probenzusatzwert'
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
17 ],
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
18
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
19 maxHeight: 350,
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
20 emptyText: 'Keine Zusatzwerte gefunden.',
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
21 minHeight: 110,
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
22 viewConfig: {
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
23 deferEmptyText: false
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
24 },
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
25 margin: '0, 5, 5, 5',
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
26
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
27 recordId: null,
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
28
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
29 initComponent: function() {
571
1dedce48e3e1 Implemented the 'add' button; fixed renderer and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 559
diff changeset
30 this.rowEditing = Ext.create('Ext.grid.plugin.RowEditing', {
548
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
31 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: 665
diff changeset
32 autoCancel: false,
703
9ab7b1eed9f8 Rowediting is now disabled when the Grid was set to ReadOnly
Dustin Demuth <dustin@intevation.de>
parents: 702
diff changeset
33 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
34 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: 665
diff changeset
35 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: 665
diff changeset
36 // 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: 665
diff changeset
37 // Normally this would belong into a controller an not the view.
702
0c8e689f3bcb Added readonly to models, Probenzusatzwertgrid does now check wheter a record is readonly and disables the roweditor in such a case
Dustin Demuth <dustin@intevation.de>
parents: 684
diff changeset
38 // 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: 665
diff changeset
39 beforeedit: function(e, o) {
702
0c8e689f3bcb Added readonly to models, Probenzusatzwertgrid does now check wheter a record is readonly and disables the roweditor in such a case
Dustin Demuth <dustin@intevation.de>
parents: 684
diff changeset
40 var readonlywin = o.grid.up('window').record.get('readonly');
0c8e689f3bcb Added readonly to models, Probenzusatzwertgrid does now check wheter a record is readonly and disables the roweditor in such a case
Dustin Demuth <dustin@intevation.de>
parents: 684
diff changeset
41 var readonlygrid = o.record.get('readonly');
703
9ab7b1eed9f8 Rowediting is now disabled when the Grid was set to ReadOnly
Dustin Demuth <dustin@intevation.de>
parents: 702
diff changeset
42 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: 665
diff changeset
43 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: 665
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: 665
diff changeset
45 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: 665
diff changeset
46 }
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: 665
diff changeset
47 }
548
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
48 });
571
1dedce48e3e1 Implemented the 'add' button; fixed renderer and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 559
diff changeset
49 this.plugins = [this.rowEditing];
548
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
50 this.dockedItems = [{
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
51 xtype: 'toolbar',
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
52 dock: 'bottom',
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
53 items: ['->', {
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
54 text: 'Hinzufügen',
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
55 icon: 'resources/img/list-add.png',
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
56 action: 'add',
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
57 probeId: this.probeId
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
58 }, {
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
59 text: 'Löschen',
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
60 icon: 'resources/img/list-remove.png',
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
61 action: 'delete'
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
62 }]
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
63 }];
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
64 this.columns = [{
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
65 header: 'PZW-ID',
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
66 dataIndex: 'id',
718
7f11b75e0188 Trailing Commas, editable: false for Umwelt und Messstelle widget
Dustin Demuth <dustin@intevation.de>
parents: 703
diff changeset
67 flex: 1
548
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
68 }, {
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
69 header: 'PZW-Größe',
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
70 dataIndex: 'pzsId',
625
f59bda7551d7 Xtype numbercolumn hinzugefügt,
Dustin Demuth <dustin@intevation.de>
parents: 571
diff changeset
71 flex: 3,
548
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
72 renderer: function(value) {
571
1dedce48e3e1 Implemented the 'add' button; fixed renderer and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 559
diff changeset
73 if (!value || value === '') {
1dedce48e3e1 Implemented the 'add' button; fixed renderer and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 559
diff changeset
74 return '';
1dedce48e3e1 Implemented the 'add' button; fixed renderer and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 559
diff changeset
75 }
548
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
76 var store = Ext.data.StoreManager.get('probenzusaetze');
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
77 var record = store.getById(value);
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
78 return record.get('beschreibung');
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
79 },
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
80 editor: {
559
9a414a49dffe Updated probenuzsatzwert grid columns and editors.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 548
diff changeset
81 xtype: 'combobox',
9a414a49dffe Updated probenuzsatzwert grid columns and editors.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 548
diff changeset
82 store: Ext.data.StoreManager.get('probenzusaetze'),
9a414a49dffe Updated probenuzsatzwert grid columns and editors.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 548
diff changeset
83 displayField: 'beschreibung',
9a414a49dffe Updated probenuzsatzwert grid columns and editors.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 548
diff changeset
84 valueField: 'id',
665
4a9bd2664da6 Field Validity in Probenzusatzwerte Grid
Dustin Demuth <dustin@intevation.de>
parents: 625
diff changeset
85 allowBlank: false,
4a9bd2664da6 Field Validity in Probenzusatzwerte Grid
Dustin Demuth <dustin@intevation.de>
parents: 625
diff changeset
86 editable: false
548
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
87 }
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
88 }, {
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
89 header: 'Messwert',
559
9a414a49dffe Updated probenuzsatzwert grid columns and editors.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 548
diff changeset
90 dataIndex: 'messwertPzs',
625
f59bda7551d7 Xtype numbercolumn hinzugefügt,
Dustin Demuth <dustin@intevation.de>
parents: 571
diff changeset
91 xtype: 'numbercolumn',
f59bda7551d7 Xtype numbercolumn hinzugefügt,
Dustin Demuth <dustin@intevation.de>
parents: 571
diff changeset
92 flex: 1,
559
9a414a49dffe Updated probenuzsatzwert grid columns and editors.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 548
diff changeset
93 editor: {
625
f59bda7551d7 Xtype numbercolumn hinzugefügt,
Dustin Demuth <dustin@intevation.de>
parents: 571
diff changeset
94 xtype: 'numberfield',
665
4a9bd2664da6 Field Validity in Probenzusatzwerte Grid
Dustin Demuth <dustin@intevation.de>
parents: 625
diff changeset
95 allowBlank: false,
4a9bd2664da6 Field Validity in Probenzusatzwerte Grid
Dustin Demuth <dustin@intevation.de>
parents: 625
diff changeset
96 maxLength: 10,
4a9bd2664da6 Field Validity in Probenzusatzwerte Grid
Dustin Demuth <dustin@intevation.de>
parents: 625
diff changeset
97 enforceMaxLength: true,
4a9bd2664da6 Field Validity in Probenzusatzwerte Grid
Dustin Demuth <dustin@intevation.de>
parents: 625
diff changeset
98 allowExponential: false
4a9bd2664da6 Field Validity in Probenzusatzwerte Grid
Dustin Demuth <dustin@intevation.de>
parents: 625
diff changeset
99 }
4a9bd2664da6 Field Validity in Probenzusatzwerte Grid
Dustin Demuth <dustin@intevation.de>
parents: 625
diff changeset
100 }, {
4a9bd2664da6 Field Validity in Probenzusatzwerte Grid
Dustin Demuth <dustin@intevation.de>
parents: 625
diff changeset
101 header: '< NWG',
4a9bd2664da6 Field Validity in Probenzusatzwerte Grid
Dustin Demuth <dustin@intevation.de>
parents: 625
diff changeset
102 flex: 1,
4a9bd2664da6 Field Validity in Probenzusatzwerte Grid
Dustin Demuth <dustin@intevation.de>
parents: 625
diff changeset
103 renderer: function(value, meta, record) {
4a9bd2664da6 Field Validity in Probenzusatzwerte Grid
Dustin Demuth <dustin@intevation.de>
parents: 625
diff changeset
104 var nwg = record.get('nwgZuMesswert');
4a9bd2664da6 Field Validity in Probenzusatzwerte Grid
Dustin Demuth <dustin@intevation.de>
parents: 625
diff changeset
105 var mw = record.get('messwertPzs');
4a9bd2664da6 Field Validity in Probenzusatzwerte Grid
Dustin Demuth <dustin@intevation.de>
parents: 625
diff changeset
106 if ( mw < nwg) {
4a9bd2664da6 Field Validity in Probenzusatzwerte Grid
Dustin Demuth <dustin@intevation.de>
parents: 625
diff changeset
107 return '<';
4a9bd2664da6 Field Validity in Probenzusatzwerte Grid
Dustin Demuth <dustin@intevation.de>
parents: 625
diff changeset
108 }
4a9bd2664da6 Field Validity in Probenzusatzwerte Grid
Dustin Demuth <dustin@intevation.de>
parents: 625
diff changeset
109 return '';
4a9bd2664da6 Field Validity in Probenzusatzwerte Grid
Dustin Demuth <dustin@intevation.de>
parents: 625
diff changeset
110 }
4a9bd2664da6 Field Validity in Probenzusatzwerte Grid
Dustin Demuth <dustin@intevation.de>
parents: 625
diff changeset
111 }, {
4a9bd2664da6 Field Validity in Probenzusatzwerte Grid
Dustin Demuth <dustin@intevation.de>
parents: 625
diff changeset
112 header: 'Nachweisgrenze',
4a9bd2664da6 Field Validity in Probenzusatzwerte Grid
Dustin Demuth <dustin@intevation.de>
parents: 625
diff changeset
113 dataIndex: 'nwgZuMesswert',
4a9bd2664da6 Field Validity in Probenzusatzwerte Grid
Dustin Demuth <dustin@intevation.de>
parents: 625
diff changeset
114 xtype: 'numbercolumn',
4a9bd2664da6 Field Validity in Probenzusatzwerte Grid
Dustin Demuth <dustin@intevation.de>
parents: 625
diff changeset
115 format: '0',
4a9bd2664da6 Field Validity in Probenzusatzwerte Grid
Dustin Demuth <dustin@intevation.de>
parents: 625
diff changeset
116 flex: 1,
4a9bd2664da6 Field Validity in Probenzusatzwerte Grid
Dustin Demuth <dustin@intevation.de>
parents: 625
diff changeset
117 editor: {
4a9bd2664da6 Field Validity in Probenzusatzwerte Grid
Dustin Demuth <dustin@intevation.de>
parents: 625
diff changeset
118 xtype: 'numberfield',
4a9bd2664da6 Field Validity in Probenzusatzwerte Grid
Dustin Demuth <dustin@intevation.de>
parents: 625
diff changeset
119 allowBlank: false,
4a9bd2664da6 Field Validity in Probenzusatzwerte Grid
Dustin Demuth <dustin@intevation.de>
parents: 625
diff changeset
120 maxLength: 10,
4a9bd2664da6 Field Validity in Probenzusatzwerte Grid
Dustin Demuth <dustin@intevation.de>
parents: 625
diff changeset
121 enforceMaxLength: true,
4a9bd2664da6 Field Validity in Probenzusatzwerte Grid
Dustin Demuth <dustin@intevation.de>
parents: 625
diff changeset
122 allowExponential: false
559
9a414a49dffe Updated probenuzsatzwert grid columns and editors.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 548
diff changeset
123 }
9a414a49dffe Updated probenuzsatzwert grid columns and editors.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 548
diff changeset
124 }, {
9a414a49dffe Updated probenuzsatzwert grid columns and editors.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 548
diff changeset
125 header: 'Maßeinheit',
9a414a49dffe Updated probenuzsatzwert grid columns and editors.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 548
diff changeset
126 dataIndex: 'pzsId',
625
f59bda7551d7 Xtype numbercolumn hinzugefügt,
Dustin Demuth <dustin@intevation.de>
parents: 571
diff changeset
127 flex: 1,
548
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
128 renderer: function(value) {
571
1dedce48e3e1 Implemented the 'add' button; fixed renderer and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 559
diff changeset
129 if (!value || value === '') {
1dedce48e3e1 Implemented the 'add' button; fixed renderer and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 559
diff changeset
130 return '';
1dedce48e3e1 Implemented the 'add' button; fixed renderer and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 559
diff changeset
131 }
559
9a414a49dffe Updated probenuzsatzwert grid columns and editors.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 548
diff changeset
132 var zstore = Ext.data.StoreManager.get('probenzusaetze');
9a414a49dffe Updated probenuzsatzwert grid columns and editors.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 548
diff changeset
133 var mstore = Ext.data.StoreManager.get('messeinheiten');
9a414a49dffe Updated probenuzsatzwert grid columns and editors.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 548
diff changeset
134 var mehId = zstore.getById(value).get('mehId');
9a414a49dffe Updated probenuzsatzwert grid columns and editors.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 548
diff changeset
135 var record = mstore.findRecord('id', mehId);
9a414a49dffe Updated probenuzsatzwert grid columns and editors.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 548
diff changeset
136 return record.get('einheit');
9a414a49dffe Updated probenuzsatzwert grid columns and editors.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 548
diff changeset
137 }
9a414a49dffe Updated probenuzsatzwert grid columns and editors.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 548
diff changeset
138 }, {
548
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
139 header: 'rel. Unsich.[%]',
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
140 dataIndex: 'messfehler',
625
f59bda7551d7 Xtype numbercolumn hinzugefügt,
Dustin Demuth <dustin@intevation.de>
parents: 571
diff changeset
141 xtype: 'numbercolumn',
f59bda7551d7 Xtype numbercolumn hinzugefügt,
Dustin Demuth <dustin@intevation.de>
parents: 571
diff changeset
142 format: '0',
f59bda7551d7 Xtype numbercolumn hinzugefügt,
Dustin Demuth <dustin@intevation.de>
parents: 571
diff changeset
143 flex: 1,
548
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
144 editor: {
625
f59bda7551d7 Xtype numbercolumn hinzugefügt,
Dustin Demuth <dustin@intevation.de>
parents: 571
diff changeset
145 xtype: 'numberfield',
665
4a9bd2664da6 Field Validity in Probenzusatzwerte Grid
Dustin Demuth <dustin@intevation.de>
parents: 625
diff changeset
146 allowBlank: false,
4a9bd2664da6 Field Validity in Probenzusatzwerte Grid
Dustin Demuth <dustin@intevation.de>
parents: 625
diff changeset
147 maxLength: 3,
4a9bd2664da6 Field Validity in Probenzusatzwerte Grid
Dustin Demuth <dustin@intevation.de>
parents: 625
diff changeset
148 enforceMaxLength: true,
4a9bd2664da6 Field Validity in Probenzusatzwerte Grid
Dustin Demuth <dustin@intevation.de>
parents: 625
diff changeset
149 allowExponential: false,
4a9bd2664da6 Field Validity in Probenzusatzwerte Grid
Dustin Demuth <dustin@intevation.de>
parents: 625
diff changeset
150 allowDecimal: false
625
f59bda7551d7 Xtype numbercolumn hinzugefügt,
Dustin Demuth <dustin@intevation.de>
parents: 571
diff changeset
151 }
548
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
152 }];
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
153 this.initData();
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
154 this.callParent(arguments);
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
155 },
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
156
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
157 initData: function() {
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
158 this.store = Ext.create('Lada.store.Zusatzwerte');
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
159 this.store.load({
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
160 params: {
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
161 probeId: this.recordId
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
162 }
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
163 });
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
164 },
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
165
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
166 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
167 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
168 //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
169 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
170 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
171 }
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 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
173 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
174 }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
175 //Writable
69cb367c0a63 When a Probeform is dirty, all child-grids are made readonly (Row Editing is not disbled correctly). When a Probe is read-only all Child-grid buttons are disabled. When a Probe is ReadOnly probeform is also readonly.
Dustin Demuth <dustin@intevation.de>
parents: 683
diff changeset
176 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
177 this.getPlugin('rowedit').enable();
69cb367c0a63 When a Probeform is dirty, all child-grids are made readonly (Row Editing is not disbled correctly). When a Probe is read-only all Child-grid buttons are disabled. When a Probe is ReadOnly probeform is also readonly.
Dustin Demuth <dustin@intevation.de>
parents: 683
diff changeset
178 }
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
179 this.down('button[action=delete]').enable();
69cb367c0a63 When a Probeform is dirty, all child-grids are made readonly (Row Editing is not disbled correctly). When a Probe is read-only all Child-grid buttons are disabled. When a Probe is ReadOnly probeform is also readonly.
Dustin Demuth <dustin@intevation.de>
parents: 683
diff changeset
180 this.down('button[action=add]').enable();
69cb367c0a63 When a Probeform is dirty, all child-grids are made readonly (Row Editing is not disbled correctly). When a Probe is read-only all Child-grid buttons are disabled. When a Probe is ReadOnly probeform is also readonly.
Dustin Demuth <dustin@intevation.de>
parents: 683
diff changeset
181 }
548
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
182 }
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
183 });

http://lada.wald.intevation.org