annotate app/view/grid/Probenzusatzwert.js @ 694:a0df1a8dff24

added setReadOnly()
author Dustin Demuth <dustin@intevation.de>
date Thu, 26 Mar 2015 16:02:38 +0100
parents 69cb367c0a63
children 0c8e689f3bcb
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,
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
33 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
34 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
35 // 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
36 // 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: 665
diff changeset
37 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: 665
diff changeset
38 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: 665
diff changeset
39 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
40 }
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
41 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
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: 665
diff changeset
43 }
548
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
44 });
571
1dedce48e3e1 Implemented the 'add' button; fixed renderer and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 559
diff changeset
45 this.plugins = [this.rowEditing];
548
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
46 this.dockedItems = [{
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
47 xtype: 'toolbar',
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
48 dock: 'bottom',
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
49 items: ['->', {
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
50 text: 'Hinzufügen',
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
51 icon: 'resources/img/list-add.png',
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
52 action: 'add',
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
53 probeId: this.probeId
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
54 }, {
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
55 text: 'Löschen',
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
56 icon: 'resources/img/list-remove.png',
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
57 action: 'delete'
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 }];
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
60 this.columns = [{
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
61 header: 'PZW-ID',
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
62 dataIndex: 'id',
625
f59bda7551d7 Xtype numbercolumn hinzugefügt,
Dustin Demuth <dustin@intevation.de>
parents: 571
diff changeset
63 flex: 1,
548
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
64 }, {
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
65 header: 'PZW-Größe',
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
66 dataIndex: 'pzsId',
625
f59bda7551d7 Xtype numbercolumn hinzugefügt,
Dustin Demuth <dustin@intevation.de>
parents: 571
diff changeset
67 flex: 3,
548
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
68 renderer: function(value) {
571
1dedce48e3e1 Implemented the 'add' button; fixed renderer and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 559
diff changeset
69 if (!value || value === '') {
1dedce48e3e1 Implemented the 'add' button; fixed renderer and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 559
diff changeset
70 return '';
1dedce48e3e1 Implemented the 'add' button; fixed renderer and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 559
diff changeset
71 }
548
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
72 var store = Ext.data.StoreManager.get('probenzusaetze');
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
73 var record = store.getById(value);
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
74 return record.get('beschreibung');
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
75 },
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
76 editor: {
559
9a414a49dffe Updated probenuzsatzwert grid columns and editors.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 548
diff changeset
77 xtype: 'combobox',
9a414a49dffe Updated probenuzsatzwert grid columns and editors.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 548
diff changeset
78 store: Ext.data.StoreManager.get('probenzusaetze'),
9a414a49dffe Updated probenuzsatzwert grid columns and editors.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 548
diff changeset
79 displayField: 'beschreibung',
9a414a49dffe Updated probenuzsatzwert grid columns and editors.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 548
diff changeset
80 valueField: 'id',
665
4a9bd2664da6 Field Validity in Probenzusatzwerte Grid
Dustin Demuth <dustin@intevation.de>
parents: 625
diff changeset
81 allowBlank: false,
4a9bd2664da6 Field Validity in Probenzusatzwerte Grid
Dustin Demuth <dustin@intevation.de>
parents: 625
diff changeset
82 editable: false
548
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
83 }
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
84 }, {
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
85 header: 'Messwert',
559
9a414a49dffe Updated probenuzsatzwert grid columns and editors.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 548
diff changeset
86 dataIndex: 'messwertPzs',
625
f59bda7551d7 Xtype numbercolumn hinzugefügt,
Dustin Demuth <dustin@intevation.de>
parents: 571
diff changeset
87 xtype: 'numbercolumn',
f59bda7551d7 Xtype numbercolumn hinzugefügt,
Dustin Demuth <dustin@intevation.de>
parents: 571
diff changeset
88 flex: 1,
559
9a414a49dffe Updated probenuzsatzwert grid columns and editors.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 548
diff changeset
89 editor: {
625
f59bda7551d7 Xtype numbercolumn hinzugefügt,
Dustin Demuth <dustin@intevation.de>
parents: 571
diff changeset
90 xtype: 'numberfield',
665
4a9bd2664da6 Field Validity in Probenzusatzwerte Grid
Dustin Demuth <dustin@intevation.de>
parents: 625
diff changeset
91 allowBlank: false,
4a9bd2664da6 Field Validity in Probenzusatzwerte Grid
Dustin Demuth <dustin@intevation.de>
parents: 625
diff changeset
92 maxLength: 10,
4a9bd2664da6 Field Validity in Probenzusatzwerte Grid
Dustin Demuth <dustin@intevation.de>
parents: 625
diff changeset
93 enforceMaxLength: true,
4a9bd2664da6 Field Validity in Probenzusatzwerte Grid
Dustin Demuth <dustin@intevation.de>
parents: 625
diff changeset
94 allowExponential: false
4a9bd2664da6 Field Validity in Probenzusatzwerte Grid
Dustin Demuth <dustin@intevation.de>
parents: 625
diff changeset
95 }
4a9bd2664da6 Field Validity in Probenzusatzwerte Grid
Dustin Demuth <dustin@intevation.de>
parents: 625
diff changeset
96 }, {
4a9bd2664da6 Field Validity in Probenzusatzwerte Grid
Dustin Demuth <dustin@intevation.de>
parents: 625
diff changeset
97 header: '< NWG',
4a9bd2664da6 Field Validity in Probenzusatzwerte Grid
Dustin Demuth <dustin@intevation.de>
parents: 625
diff changeset
98 flex: 1,
4a9bd2664da6 Field Validity in Probenzusatzwerte Grid
Dustin Demuth <dustin@intevation.de>
parents: 625
diff changeset
99 renderer: function(value, meta, record) {
4a9bd2664da6 Field Validity in Probenzusatzwerte Grid
Dustin Demuth <dustin@intevation.de>
parents: 625
diff changeset
100 var nwg = record.get('nwgZuMesswert');
4a9bd2664da6 Field Validity in Probenzusatzwerte Grid
Dustin Demuth <dustin@intevation.de>
parents: 625
diff changeset
101 var mw = record.get('messwertPzs');
4a9bd2664da6 Field Validity in Probenzusatzwerte Grid
Dustin Demuth <dustin@intevation.de>
parents: 625
diff changeset
102 if ( mw < nwg) {
4a9bd2664da6 Field Validity in Probenzusatzwerte Grid
Dustin Demuth <dustin@intevation.de>
parents: 625
diff changeset
103 return '<';
4a9bd2664da6 Field Validity in Probenzusatzwerte Grid
Dustin Demuth <dustin@intevation.de>
parents: 625
diff changeset
104 }
4a9bd2664da6 Field Validity in Probenzusatzwerte Grid
Dustin Demuth <dustin@intevation.de>
parents: 625
diff changeset
105 return '';
4a9bd2664da6 Field Validity in Probenzusatzwerte Grid
Dustin Demuth <dustin@intevation.de>
parents: 625
diff changeset
106 }
4a9bd2664da6 Field Validity in Probenzusatzwerte Grid
Dustin Demuth <dustin@intevation.de>
parents: 625
diff changeset
107 }, {
4a9bd2664da6 Field Validity in Probenzusatzwerte Grid
Dustin Demuth <dustin@intevation.de>
parents: 625
diff changeset
108 header: 'Nachweisgrenze',
4a9bd2664da6 Field Validity in Probenzusatzwerte Grid
Dustin Demuth <dustin@intevation.de>
parents: 625
diff changeset
109 dataIndex: 'nwgZuMesswert',
4a9bd2664da6 Field Validity in Probenzusatzwerte Grid
Dustin Demuth <dustin@intevation.de>
parents: 625
diff changeset
110 xtype: 'numbercolumn',
4a9bd2664da6 Field Validity in Probenzusatzwerte Grid
Dustin Demuth <dustin@intevation.de>
parents: 625
diff changeset
111 format: '0',
4a9bd2664da6 Field Validity in Probenzusatzwerte Grid
Dustin Demuth <dustin@intevation.de>
parents: 625
diff changeset
112 flex: 1,
4a9bd2664da6 Field Validity in Probenzusatzwerte Grid
Dustin Demuth <dustin@intevation.de>
parents: 625
diff changeset
113 editor: {
4a9bd2664da6 Field Validity in Probenzusatzwerte Grid
Dustin Demuth <dustin@intevation.de>
parents: 625
diff changeset
114 xtype: 'numberfield',
4a9bd2664da6 Field Validity in Probenzusatzwerte Grid
Dustin Demuth <dustin@intevation.de>
parents: 625
diff changeset
115 allowBlank: false,
4a9bd2664da6 Field Validity in Probenzusatzwerte Grid
Dustin Demuth <dustin@intevation.de>
parents: 625
diff changeset
116 maxLength: 10,
4a9bd2664da6 Field Validity in Probenzusatzwerte Grid
Dustin Demuth <dustin@intevation.de>
parents: 625
diff changeset
117 enforceMaxLength: true,
4a9bd2664da6 Field Validity in Probenzusatzwerte Grid
Dustin Demuth <dustin@intevation.de>
parents: 625
diff changeset
118 allowExponential: false
559
9a414a49dffe Updated probenuzsatzwert grid columns and editors.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 548
diff changeset
119 }
9a414a49dffe Updated probenuzsatzwert grid columns and editors.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 548
diff changeset
120 }, {
9a414a49dffe Updated probenuzsatzwert grid columns and editors.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 548
diff changeset
121 header: 'Maßeinheit',
9a414a49dffe Updated probenuzsatzwert grid columns and editors.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 548
diff changeset
122 dataIndex: 'pzsId',
625
f59bda7551d7 Xtype numbercolumn hinzugefügt,
Dustin Demuth <dustin@intevation.de>
parents: 571
diff changeset
123 flex: 1,
548
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
124 renderer: function(value) {
571
1dedce48e3e1 Implemented the 'add' button; fixed renderer and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 559
diff changeset
125 if (!value || value === '') {
1dedce48e3e1 Implemented the 'add' button; fixed renderer and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 559
diff changeset
126 return '';
1dedce48e3e1 Implemented the 'add' button; fixed renderer and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 559
diff changeset
127 }
559
9a414a49dffe Updated probenuzsatzwert grid columns and editors.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 548
diff changeset
128 var zstore = Ext.data.StoreManager.get('probenzusaetze');
9a414a49dffe Updated probenuzsatzwert grid columns and editors.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 548
diff changeset
129 var mstore = Ext.data.StoreManager.get('messeinheiten');
9a414a49dffe Updated probenuzsatzwert grid columns and editors.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 548
diff changeset
130 var mehId = zstore.getById(value).get('mehId');
9a414a49dffe Updated probenuzsatzwert grid columns and editors.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 548
diff changeset
131 var record = mstore.findRecord('id', mehId);
9a414a49dffe Updated probenuzsatzwert grid columns and editors.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 548
diff changeset
132 return record.get('einheit');
9a414a49dffe Updated probenuzsatzwert grid columns and editors.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 548
diff changeset
133 }
9a414a49dffe Updated probenuzsatzwert grid columns and editors.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 548
diff changeset
134 }, {
548
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
135 header: 'rel. Unsich.[%]',
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
136 dataIndex: 'messfehler',
625
f59bda7551d7 Xtype numbercolumn hinzugefügt,
Dustin Demuth <dustin@intevation.de>
parents: 571
diff changeset
137 xtype: 'numbercolumn',
f59bda7551d7 Xtype numbercolumn hinzugefügt,
Dustin Demuth <dustin@intevation.de>
parents: 571
diff changeset
138 format: '0',
f59bda7551d7 Xtype numbercolumn hinzugefügt,
Dustin Demuth <dustin@intevation.de>
parents: 571
diff changeset
139 flex: 1,
548
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
140 editor: {
625
f59bda7551d7 Xtype numbercolumn hinzugefügt,
Dustin Demuth <dustin@intevation.de>
parents: 571
diff changeset
141 xtype: 'numberfield',
665
4a9bd2664da6 Field Validity in Probenzusatzwerte Grid
Dustin Demuth <dustin@intevation.de>
parents: 625
diff changeset
142 allowBlank: false,
4a9bd2664da6 Field Validity in Probenzusatzwerte Grid
Dustin Demuth <dustin@intevation.de>
parents: 625
diff changeset
143 maxLength: 3,
4a9bd2664da6 Field Validity in Probenzusatzwerte Grid
Dustin Demuth <dustin@intevation.de>
parents: 625
diff changeset
144 enforceMaxLength: true,
4a9bd2664da6 Field Validity in Probenzusatzwerte Grid
Dustin Demuth <dustin@intevation.de>
parents: 625
diff changeset
145 allowExponential: false,
4a9bd2664da6 Field Validity in Probenzusatzwerte Grid
Dustin Demuth <dustin@intevation.de>
parents: 625
diff changeset
146 allowDecimal: false
625
f59bda7551d7 Xtype numbercolumn hinzugefügt,
Dustin Demuth <dustin@intevation.de>
parents: 571
diff changeset
147 }
548
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
148 }];
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
149 this.initData();
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
150 this.callParent(arguments);
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
151 },
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 initData: function() {
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
154 this.store = Ext.create('Lada.store.Zusatzwerte');
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
155 this.store.load({
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
156 params: {
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
157 probeId: this.recordId
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
158 }
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
159 });
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
160 },
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
161
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
162 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
163 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
164 //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
165 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
166 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
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 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
169 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
170 }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
171 //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
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').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
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]').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
176 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
177 }
548
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
178 }
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
179 });

http://lada.wald.intevation.org