annotate app/view/grid/Ortszuordnung.js @ 1014:e9e974d31924 stammdatengrids

Set mandatory fields
author Dustin Demuth <dustin@intevation.de>
date Fri, 29 Jan 2016 14:51:17 +0100
parents 2adc329d90fe
children 1df6b6210b42
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
893
07dfcdf5b41f jsduck for grids and panels
Dustin Demuth <dustin@intevation.de>
parents: 824
diff changeset
9 /**
1004
9ac03f461ab4 Introduced Orte into Stammdatengrids, Added Ortszuordnung. THIS COMMIT IS WORK IN PROGRESS, Proben will NOT work after this commit. Orte can not be edited.
Dustin Demuth <dustin@intevation.de>
parents: 893
diff changeset
10 * Grid to list Ortszuordnungen
548
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
11 */
1004
9ac03f461ab4 Introduced Orte into Stammdatengrids, Added Ortszuordnung. THIS COMMIT IS WORK IN PROGRESS, Proben will NOT work after this commit. Orte can not be edited.
Dustin Demuth <dustin@intevation.de>
parents: 893
diff changeset
12 Ext.define('Lada.view.grid.Ortszuordnung', {
548
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
13 extend: 'Ext.grid.Panel',
1012
2adc329d90fe Replaced Locations with Ortszuordnung
Dustin Demuth <dustin@intevation.de>
parents: 1004
diff changeset
14 alias: 'widget.ortszuordnunggrid',
548
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
15
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
16 maxHeight: 350,
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
17 emptyText: 'Keine Orte gefunden.',
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
18 // minHeight and deferEmptyText are needed to be able to show the
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
19 // emptyText message.
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
20 minHeight: 110,
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
21 viewConfig: {
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
22 deferEmptyText: false
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
23 },
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
24 margin: '0, 5, 5, 5',
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
25
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
26 recordId: null,
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
27
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
28 warnings: null,
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
29 errors: null,
823
5ed0e6273888 Only enable delete button in grids when an entry was selected
Dustin Demuth <dustin@intevation.de>
parents: 684
diff changeset
30 readOnly: true,
5ed0e6273888 Only enable delete button in grids when an entry was selected
Dustin Demuth <dustin@intevation.de>
parents: 684
diff changeset
31 allowDeselect: true,
548
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
32
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
33 initComponent: function() {
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
34 this.dockedItems = [{
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
35 xtype: 'toolbar',
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
36 dock: 'bottom',
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
37 items: ['->', {
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
38 text: 'Hinzufügen',
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
39 icon: 'resources/img/list-add.png',
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
40 action: 'add',
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
41 probeId: this.probeId
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
42 }, {
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
43 text: 'Löschen',
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
44 icon: 'resources/img/list-remove.png',
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
45 action: 'delete'
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
46 }]
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
47 }];
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
48 this.columns = [{
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
49 header: 'Typ',
1012
2adc329d90fe Replaced Locations with Ortszuordnung
Dustin Demuth <dustin@intevation.de>
parents: 1004
diff changeset
50 dataIndex: 'ortszuordnungTyp',
548
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
51 width: 50,
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
52 editor: {
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
53 allowBlank: false
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 }, {
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
56 header: 'Staat',
1012
2adc329d90fe Replaced Locations with Ortszuordnung
Dustin Demuth <dustin@intevation.de>
parents: 1004
diff changeset
57 dataIndex: 'ortId',
548
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
58 width: 70,
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
59 renderer: function(value) {
1004
9ac03f461ab4 Introduced Orte into Stammdatengrids, Added Ortszuordnung. THIS COMMIT IS WORK IN PROGRESS, Proben will NOT work after this commit. Orte can not be edited.
Dustin Demuth <dustin@intevation.de>
parents: 893
diff changeset
60 var store = Ext.data.StoreManager.get('orte');
548
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
61 var staaten = Ext.data.StoreManager.get('staaten');
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
62 var record =
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
63 staaten.getById(store.getById(value).get('staatId'));
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
64 return record.get('staatIso');
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
65 }
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
66 }, {
1012
2adc329d90fe Replaced Locations with Ortszuordnung
Dustin Demuth <dustin@intevation.de>
parents: 1004
diff changeset
67 header: 'Gemeindeschlüssel',
2adc329d90fe Replaced Locations with Ortszuordnung
Dustin Demuth <dustin@intevation.de>
parents: 1004
diff changeset
68 dataIndex: 'ortId',
548
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
69 width: 120,
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
70 renderer: function(value) {
1004
9ac03f461ab4 Introduced Orte into Stammdatengrids, Added Ortszuordnung. THIS COMMIT IS WORK IN PROGRESS, Proben will NOT work after this commit. Orte can not be edited.
Dustin Demuth <dustin@intevation.de>
parents: 893
diff changeset
71 var store = Ext.data.StoreManager.get('orte');
548
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
72 var record = store.getById(value);
1004
9ac03f461ab4 Introduced Orte into Stammdatengrids, Added Ortszuordnung. THIS COMMIT IS WORK IN PROGRESS, Proben will NOT work after this commit. Orte can not be edited.
Dustin Demuth <dustin@intevation.de>
parents: 893
diff changeset
73 return record.get('gemId');
548
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
74 }
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 header: 'Gemeindename',
1012
2adc329d90fe Replaced Locations with Ortszuordnung
Dustin Demuth <dustin@intevation.de>
parents: 1004
diff changeset
77 dataIndex: 'ortId',
548
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
78 flex: 1,
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
79 renderer: function(value) {
1004
9ac03f461ab4 Introduced Orte into Stammdatengrids, Added Ortszuordnung. THIS COMMIT IS WORK IN PROGRESS, Proben will NOT work after this commit. Orte can not be edited.
Dustin Demuth <dustin@intevation.de>
parents: 893
diff changeset
80 var store = Ext.data.StoreManager.get('orte');
548
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
81 var gemeinden =
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
82 Ext.data.StoreManager.get('verwaltungseinheiten');
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
83 var record = store.getById(value);
1004
9ac03f461ab4 Introduced Orte into Stammdatengrids, Added Ortszuordnung. THIS COMMIT IS WORK IN PROGRESS, Proben will NOT work after this commit. Orte can not be edited.
Dustin Demuth <dustin@intevation.de>
parents: 893
diff changeset
84 var gemid = record.get('gemId');
548
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
85 var record2 = gemeinden.getById(gemid);
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
86 return record2.get('bezeichnung');
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 }, {
1012
2adc329d90fe Replaced Locations with Ortszuordnung
Dustin Demuth <dustin@intevation.de>
parents: 1004
diff changeset
89 header: 'Ortszusatztext',
2adc329d90fe Replaced Locations with Ortszuordnung
Dustin Demuth <dustin@intevation.de>
parents: 1004
diff changeset
90 dataIndex: 'ortszusatztext'
548
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
91 }];
823
5ed0e6273888 Only enable delete button in grids when an entry was selected
Dustin Demuth <dustin@intevation.de>
parents: 684
diff changeset
92 this.listeners = {
5ed0e6273888 Only enable delete button in grids when an entry was selected
Dustin Demuth <dustin@intevation.de>
parents: 684
diff changeset
93 select: {
5ed0e6273888 Only enable delete button in grids when an entry was selected
Dustin Demuth <dustin@intevation.de>
parents: 684
diff changeset
94 fn: this.activateRemoveButton,
5ed0e6273888 Only enable delete button in grids when an entry was selected
Dustin Demuth <dustin@intevation.de>
parents: 684
diff changeset
95 scope: this
5ed0e6273888 Only enable delete button in grids when an entry was selected
Dustin Demuth <dustin@intevation.de>
parents: 684
diff changeset
96 },
5ed0e6273888 Only enable delete button in grids when an entry was selected
Dustin Demuth <dustin@intevation.de>
parents: 684
diff changeset
97 deselect: {
5ed0e6273888 Only enable delete button in grids when an entry was selected
Dustin Demuth <dustin@intevation.de>
parents: 684
diff changeset
98 fn: this.deactivateRemoveButton,
5ed0e6273888 Only enable delete button in grids when an entry was selected
Dustin Demuth <dustin@intevation.de>
parents: 684
diff changeset
99 scope: this
5ed0e6273888 Only enable delete button in grids when an entry was selected
Dustin Demuth <dustin@intevation.de>
parents: 684
diff changeset
100 }
5ed0e6273888 Only enable delete button in grids when an entry was selected
Dustin Demuth <dustin@intevation.de>
parents: 684
diff changeset
101 };
548
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
102 this.initData();
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
103 this.callParent(arguments);
823
5ed0e6273888 Only enable delete button in grids when an entry was selected
Dustin Demuth <dustin@intevation.de>
parents: 684
diff changeset
104 this.setReadOnly(true); //Grid is always initialised as RO
548
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
105 },
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
106
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
107 initData: function() {
1004
9ac03f461ab4 Introduced Orte into Stammdatengrids, Added Ortszuordnung. THIS COMMIT IS WORK IN PROGRESS, Proben will NOT work after this commit. Orte can not be edited.
Dustin Demuth <dustin@intevation.de>
parents: 893
diff changeset
108 this.store = Ext.create('Lada.store.Ortszuordnung');
548
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
109 this.store.load({
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
110 params: {
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
111 probeId: this.recordId
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
112 }
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
113 });
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
114 Ext.ClassManager.get('Lada.model.Probe').load(this.recordId, {
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
115 failure: function(record, action) {
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
116 // TODO
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
117 },
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
118 success: function(record, response) {
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
119 var json = Ext.decode(response.response.responseText);
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
120 if (json) {
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
121 this.warnings = json.warnings;
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
122 this.errors = json.errors;
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
123 }
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
124 },
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
125 scope: this
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
126 });
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
127 },
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
128
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: 600
diff changeset
129 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: 600
diff changeset
130 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: 600
diff changeset
131 //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: 600
diff changeset
132 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: 600
diff changeset
133 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: 600
diff changeset
134 }
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: 600
diff changeset
135 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: 600
diff changeset
136 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: 600
diff changeset
137 }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: 600
diff changeset
138 //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: 600
diff changeset
139 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: 600
diff changeset
140 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: 600
diff changeset
141 }
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: 823
diff changeset
142 //this.down('button[action=delete]').enable();
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: 600
diff changeset
143 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: 600
diff changeset
144 }
823
5ed0e6273888 Only enable delete button in grids when an entry was selected
Dustin Demuth <dustin@intevation.de>
parents: 684
diff changeset
145 },
5ed0e6273888 Only enable delete button in grids when an entry was selected
Dustin Demuth <dustin@intevation.de>
parents: 684
diff changeset
146 /**
5ed0e6273888 Only enable delete button in grids when an entry was selected
Dustin Demuth <dustin@intevation.de>
parents: 684
diff changeset
147 * Activate the Remove Button
5ed0e6273888 Only enable delete button in grids when an entry was selected
Dustin Demuth <dustin@intevation.de>
parents: 684
diff changeset
148 */
5ed0e6273888 Only enable delete button in grids when an entry was selected
Dustin Demuth <dustin@intevation.de>
parents: 684
diff changeset
149 activateRemoveButton: function(selection, record) {
5ed0e6273888 Only enable delete button in grids when an entry was selected
Dustin Demuth <dustin@intevation.de>
parents: 684
diff changeset
150 var grid = this;
5ed0e6273888 Only enable delete button in grids when an entry was selected
Dustin Demuth <dustin@intevation.de>
parents: 684
diff changeset
151 //only enable the remove buttone, when the grid is editable.
5ed0e6273888 Only enable delete button in grids when an entry was selected
Dustin Demuth <dustin@intevation.de>
parents: 684
diff changeset
152 if (! grid.readOnly) {
5ed0e6273888 Only enable delete button in grids when an entry was selected
Dustin Demuth <dustin@intevation.de>
parents: 684
diff changeset
153 grid.down('button[action=delete]').enable();
5ed0e6273888 Only enable delete button in grids when an entry was selected
Dustin Demuth <dustin@intevation.de>
parents: 684
diff changeset
154 }
5ed0e6273888 Only enable delete button in grids when an entry was selected
Dustin Demuth <dustin@intevation.de>
parents: 684
diff changeset
155 },
5ed0e6273888 Only enable delete button in grids when an entry was selected
Dustin Demuth <dustin@intevation.de>
parents: 684
diff changeset
156 /**
5ed0e6273888 Only enable delete button in grids when an entry was selected
Dustin Demuth <dustin@intevation.de>
parents: 684
diff changeset
157 * Activate the Remove Button
5ed0e6273888 Only enable delete button in grids when an entry was selected
Dustin Demuth <dustin@intevation.de>
parents: 684
diff changeset
158 */
5ed0e6273888 Only enable delete button in grids when an entry was selected
Dustin Demuth <dustin@intevation.de>
parents: 684
diff changeset
159 deactivateRemoveButton: function(selection, record) {
5ed0e6273888 Only enable delete button in grids when an entry was selected
Dustin Demuth <dustin@intevation.de>
parents: 684
diff changeset
160 var grid = this;
5ed0e6273888 Only enable delete button in grids when an entry was selected
Dustin Demuth <dustin@intevation.de>
parents: 684
diff changeset
161 //only enable the remove buttone, when the grid is editable.
5ed0e6273888 Only enable delete button in grids when an entry was selected
Dustin Demuth <dustin@intevation.de>
parents: 684
diff changeset
162 if (! grid.readOnly) {
5ed0e6273888 Only enable delete button in grids when an entry was selected
Dustin Demuth <dustin@intevation.de>
parents: 684
diff changeset
163 grid.down('button[action=delete]').disable();
5ed0e6273888 Only enable delete button in grids when an entry was selected
Dustin Demuth <dustin@intevation.de>
parents: 684
diff changeset
164 }
548
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
165 }
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
166 });

http://lada.wald.intevation.org