Mercurial > lada > lada-client
annotate app/view/grid/PKommentar.js @ 843:05124d559e59
Removed debugger breakpoint
author | Dustin Demuth <dustin@intevation.de> |
---|---|
date | Tue, 07 Jul 2015 09:57:20 +0200 |
parents | fab0b7be5aca |
children | 07dfcdf5b41f |
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 Kommentare |
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.PKommentar', { |
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.pkommentargrid', |
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 requires: [ |
572
2c8aa09402a2
Added controller for PKommentarGrid and implemented update/add/delete.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
548
diff
changeset
|
17 'Ext.toolbar.Toolbar', |
2c8aa09402a2
Added controller for PKommentarGrid and implemented update/add/delete.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
548
diff
changeset
|
18 'Lada.store.PKommentare' |
548
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
19 ], |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
20 |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
21 maxHeight: 350, |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
22 emptyText: 'Keine Kommentaregefunden.', |
572
2c8aa09402a2
Added controller for PKommentarGrid and implemented update/add/delete.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
548
diff
changeset
|
23 minHeight: 110, |
548
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
24 viewConfig: { |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
25 deferEmptyText: false |
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 |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
28 recordId: null, |
823
5ed0e6273888
Only enable delete button in grids when an entry was selected
Dustin Demuth <dustin@intevation.de>
parents:
703
diff
changeset
|
29 readOnly: true, |
5ed0e6273888
Only enable delete button in grids when an entry was selected
Dustin Demuth <dustin@intevation.de>
parents:
703
diff
changeset
|
30 allowDeselect: true, |
548
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
31 |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
32 initComponent: function() { |
572
2c8aa09402a2
Added controller for PKommentarGrid and implemented update/add/delete.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
548
diff
changeset
|
33 this.rowEditing = Ext.create('Ext.grid.plugin.RowEditing', { |
548
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
34 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:
572
diff
changeset
|
35 autoCancel: false, |
703
9ab7b1eed9f8
Rowediting is now disabled when the Grid was set to ReadOnly
Dustin Demuth <dustin@intevation.de>
parents:
684
diff
changeset
|
36 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
|
37 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:
572
diff
changeset
|
38 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:
572
diff
changeset
|
39 // 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:
572
diff
changeset
|
40 // Normally this would belong into a controller an not the view. |
703
9ab7b1eed9f8
Rowediting is now disabled when the Grid was set to ReadOnly
Dustin Demuth <dustin@intevation.de>
parents:
684
diff
changeset
|
41 // 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:
572
diff
changeset
|
42 beforeedit: function(e, o) { |
703
9ab7b1eed9f8
Rowediting is now disabled when the Grid was set to ReadOnly
Dustin Demuth <dustin@intevation.de>
parents:
684
diff
changeset
|
43 var readonlywin = o.grid.up('window').record.get('readonly'); |
9ab7b1eed9f8
Rowediting is now disabled when the Grid was set to ReadOnly
Dustin Demuth <dustin@intevation.de>
parents:
684
diff
changeset
|
44 var readonlygrid = o.record.get('readonly'); |
9ab7b1eed9f8
Rowediting is now disabled when the Grid was set to ReadOnly
Dustin Demuth <dustin@intevation.de>
parents:
684
diff
changeset
|
45 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:
572
diff
changeset
|
46 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:
572
diff
changeset
|
47 } |
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:
572
diff
changeset
|
48 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:
572
diff
changeset
|
49 } |
612f4f933083
Made Grid-Rows uneditable if the dataset contains readonly=true. This only affects the Grids using the RowEdit Plugin
Dustin Demuth <dustin@intevation.de>
parents:
572
diff
changeset
|
50 } |
703
9ab7b1eed9f8
Rowediting is now disabled when the Grid was set to ReadOnly
Dustin Demuth <dustin@intevation.de>
parents:
684
diff
changeset
|
51 }); |
572
2c8aa09402a2
Added controller for PKommentarGrid and implemented update/add/delete.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
548
diff
changeset
|
52 this.plugins = [this.rowEditing]; |
548
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
53 this.dockedItems = [{ |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
54 xtype: 'toolbar', |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
55 dock: 'bottom', |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
56 items: ['->', { |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
57 text: 'Hinzufügen', |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
58 icon: 'resources/img/list-add.png', |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
59 action: 'add', |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
60 probeId: this.probeId |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
61 }, { |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
62 text: 'Löschen', |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
63 icon: 'resources/img/list-remove.png', |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
64 action: 'delete' |
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 }]; |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
67 this.columns = [{ |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
68 header: 'Erzeuger', |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
69 dataIndex: 'erzeuger', |
572
2c8aa09402a2
Added controller for PKommentarGrid and implemented update/add/delete.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
548
diff
changeset
|
70 width: 140, |
2c8aa09402a2
Added controller for PKommentarGrid and implemented update/add/delete.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
548
diff
changeset
|
71 renderer: function(value) { |
2c8aa09402a2
Added controller for PKommentarGrid and implemented update/add/delete.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
548
diff
changeset
|
72 if (!value || value === '') { |
2c8aa09402a2
Added controller for PKommentarGrid and implemented update/add/delete.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
548
diff
changeset
|
73 return ''; |
2c8aa09402a2
Added controller for PKommentarGrid and implemented update/add/delete.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
548
diff
changeset
|
74 } |
2c8aa09402a2
Added controller for PKommentarGrid and implemented update/add/delete.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
548
diff
changeset
|
75 var store = Ext.data.StoreManager.get('messstellen'); |
2c8aa09402a2
Added controller for PKommentarGrid and implemented update/add/delete.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
548
diff
changeset
|
76 var record = store.getById(value); |
2c8aa09402a2
Added controller for PKommentarGrid and implemented update/add/delete.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
548
diff
changeset
|
77 return record.get('messStelle'); |
2c8aa09402a2
Added controller for PKommentarGrid and implemented update/add/delete.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
548
diff
changeset
|
78 }, |
548
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
79 editor: { |
572
2c8aa09402a2
Added controller for PKommentarGrid and implemented update/add/delete.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
548
diff
changeset
|
80 xtype: 'combobox', |
2c8aa09402a2
Added controller for PKommentarGrid and implemented update/add/delete.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
548
diff
changeset
|
81 store: Ext.data.StoreManager.get('messstellen'), |
2c8aa09402a2
Added controller for PKommentarGrid and implemented update/add/delete.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
548
diff
changeset
|
82 displayField: 'messStelle', |
2c8aa09402a2
Added controller for PKommentarGrid and implemented update/add/delete.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
548
diff
changeset
|
83 valueField: 'id', |
548
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
84 allowBlank: false |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
85 } |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
86 }, { |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
87 header: 'Datum', |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
88 dataIndex: 'datum', |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
89 editor: { |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
90 xtype: 'datefield', |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
91 allowBlank: false, |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
92 format: 'd.m.Y', |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
93 maxValue: Ext.Date.format(new Date(), 'd.m.Y') |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
94 } |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
95 }, { |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
96 header: 'Text', |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
97 dataIndex: 'text', |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
98 flex: 1, |
572
2c8aa09402a2
Added controller for PKommentarGrid and implemented update/add/delete.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
548
diff
changeset
|
99 renderer: function(value) { |
2c8aa09402a2
Added controller for PKommentarGrid and implemented update/add/delete.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
548
diff
changeset
|
100 return '<div style="white-space: normal !important;">' + |
2c8aa09402a2
Added controller for PKommentarGrid and implemented update/add/delete.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
548
diff
changeset
|
101 value + '</div>'; |
2c8aa09402a2
Added controller for PKommentarGrid and implemented update/add/delete.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
548
diff
changeset
|
102 }, |
548
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
103 editor: { |
572
2c8aa09402a2
Added controller for PKommentarGrid and implemented update/add/delete.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
548
diff
changeset
|
104 xtype: 'textarea', |
548
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
105 allowBlank: false |
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 }]; |
823
5ed0e6273888
Only enable delete button in grids when an entry was selected
Dustin Demuth <dustin@intevation.de>
parents:
703
diff
changeset
|
108 this.listeners = { |
5ed0e6273888
Only enable delete button in grids when an entry was selected
Dustin Demuth <dustin@intevation.de>
parents:
703
diff
changeset
|
109 select: { |
5ed0e6273888
Only enable delete button in grids when an entry was selected
Dustin Demuth <dustin@intevation.de>
parents:
703
diff
changeset
|
110 fn: this.activateRemoveButton, |
5ed0e6273888
Only enable delete button in grids when an entry was selected
Dustin Demuth <dustin@intevation.de>
parents:
703
diff
changeset
|
111 scope: this |
5ed0e6273888
Only enable delete button in grids when an entry was selected
Dustin Demuth <dustin@intevation.de>
parents:
703
diff
changeset
|
112 }, |
5ed0e6273888
Only enable delete button in grids when an entry was selected
Dustin Demuth <dustin@intevation.de>
parents:
703
diff
changeset
|
113 deselect: { |
5ed0e6273888
Only enable delete button in grids when an entry was selected
Dustin Demuth <dustin@intevation.de>
parents:
703
diff
changeset
|
114 fn: this.deactivateRemoveButton, |
5ed0e6273888
Only enable delete button in grids when an entry was selected
Dustin Demuth <dustin@intevation.de>
parents:
703
diff
changeset
|
115 scope: this |
5ed0e6273888
Only enable delete button in grids when an entry was selected
Dustin Demuth <dustin@intevation.de>
parents:
703
diff
changeset
|
116 } |
5ed0e6273888
Only enable delete button in grids when an entry was selected
Dustin Demuth <dustin@intevation.de>
parents:
703
diff
changeset
|
117 }; |
572
2c8aa09402a2
Added controller for PKommentarGrid and implemented update/add/delete.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
548
diff
changeset
|
118 this.initData(); |
548
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
119 this.callParent(arguments); |
823
5ed0e6273888
Only enable delete button in grids when an entry was selected
Dustin Demuth <dustin@intevation.de>
parents:
703
diff
changeset
|
120 this.setReadOnly(true); //Grid is always initialised as RO |
572
2c8aa09402a2
Added controller for PKommentarGrid and implemented update/add/delete.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
548
diff
changeset
|
121 }, |
2c8aa09402a2
Added controller for PKommentarGrid and implemented update/add/delete.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
548
diff
changeset
|
122 |
2c8aa09402a2
Added controller for PKommentarGrid and implemented update/add/delete.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
548
diff
changeset
|
123 initData: function() { |
2c8aa09402a2
Added controller for PKommentarGrid and implemented update/add/delete.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
548
diff
changeset
|
124 this.store = Ext.create('Lada.store.PKommentare'); |
2c8aa09402a2
Added controller for PKommentarGrid and implemented update/add/delete.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
548
diff
changeset
|
125 this.store.load({ |
2c8aa09402a2
Added controller for PKommentarGrid and implemented update/add/delete.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
548
diff
changeset
|
126 params: { |
2c8aa09402a2
Added controller for PKommentarGrid and implemented update/add/delete.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
548
diff
changeset
|
127 probeId: this.recordId |
2c8aa09402a2
Added controller for PKommentarGrid and implemented update/add/delete.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
548
diff
changeset
|
128 } |
2c8aa09402a2
Added controller for PKommentarGrid and implemented update/add/delete.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
548
diff
changeset
|
129 }); |
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
|
130 }, |
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
|
131 |
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
|
132 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
|
133 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
|
134 //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
|
135 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
|
136 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
|
137 } |
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
|
138 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
|
139 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
|
140 }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
|
141 //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
|
142 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
|
143 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
|
144 } |
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
|
145 //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:
683
diff
changeset
|
146 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
|
147 } |
823
5ed0e6273888
Only enable delete button in grids when an entry was selected
Dustin Demuth <dustin@intevation.de>
parents:
703
diff
changeset
|
148 }, |
5ed0e6273888
Only enable delete button in grids when an entry was selected
Dustin Demuth <dustin@intevation.de>
parents:
703
diff
changeset
|
149 /** |
5ed0e6273888
Only enable delete button in grids when an entry was selected
Dustin Demuth <dustin@intevation.de>
parents:
703
diff
changeset
|
150 * Activate the Remove Button |
5ed0e6273888
Only enable delete button in grids when an entry was selected
Dustin Demuth <dustin@intevation.de>
parents:
703
diff
changeset
|
151 */ |
5ed0e6273888
Only enable delete button in grids when an entry was selected
Dustin Demuth <dustin@intevation.de>
parents:
703
diff
changeset
|
152 activateRemoveButton: function(selection, record) { |
5ed0e6273888
Only enable delete button in grids when an entry was selected
Dustin Demuth <dustin@intevation.de>
parents:
703
diff
changeset
|
153 var grid = this; |
5ed0e6273888
Only enable delete button in grids when an entry was selected
Dustin Demuth <dustin@intevation.de>
parents:
703
diff
changeset
|
154 //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:
703
diff
changeset
|
155 if (! grid.readOnly) { |
5ed0e6273888
Only enable delete button in grids when an entry was selected
Dustin Demuth <dustin@intevation.de>
parents:
703
diff
changeset
|
156 grid.down('button[action=delete]').enable(); |
5ed0e6273888
Only enable delete button in grids when an entry was selected
Dustin Demuth <dustin@intevation.de>
parents:
703
diff
changeset
|
157 } |
5ed0e6273888
Only enable delete button in grids when an entry was selected
Dustin Demuth <dustin@intevation.de>
parents:
703
diff
changeset
|
158 }, |
5ed0e6273888
Only enable delete button in grids when an entry was selected
Dustin Demuth <dustin@intevation.de>
parents:
703
diff
changeset
|
159 /** |
5ed0e6273888
Only enable delete button in grids when an entry was selected
Dustin Demuth <dustin@intevation.de>
parents:
703
diff
changeset
|
160 * Activate the Remove Button |
5ed0e6273888
Only enable delete button in grids when an entry was selected
Dustin Demuth <dustin@intevation.de>
parents:
703
diff
changeset
|
161 */ |
5ed0e6273888
Only enable delete button in grids when an entry was selected
Dustin Demuth <dustin@intevation.de>
parents:
703
diff
changeset
|
162 deactivateRemoveButton: function(selection, record) { |
5ed0e6273888
Only enable delete button in grids when an entry was selected
Dustin Demuth <dustin@intevation.de>
parents:
703
diff
changeset
|
163 var grid = this; |
5ed0e6273888
Only enable delete button in grids when an entry was selected
Dustin Demuth <dustin@intevation.de>
parents:
703
diff
changeset
|
164 //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:
703
diff
changeset
|
165 if (! grid.readOnly) { |
5ed0e6273888
Only enable delete button in grids when an entry was selected
Dustin Demuth <dustin@intevation.de>
parents:
703
diff
changeset
|
166 grid.down('button[action=delete]').disable(); |
5ed0e6273888
Only enable delete button in grids when an entry was selected
Dustin Demuth <dustin@intevation.de>
parents:
703
diff
changeset
|
167 } |
548
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
168 } |
823
5ed0e6273888
Only enable delete button in grids when an entry was selected
Dustin Demuth <dustin@intevation.de>
parents:
703
diff
changeset
|
169 |
548
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
170 }); |