comparison app/view/grid/Messwert.js @ 1112:e76551a6da27

Use custom row expander in messung list grid.
author Raimund Renkert <raimund.renkert@intevation.de>
date Tue, 17 May 2016 17:12:33 +0200
parents 7e801af49eeb
children b73f9a976c82
comparison
equal deleted inserted replaced
1111:a73726bba79c 1112:e76551a6da27
28 28
29 recordId: null, 29 recordId: null,
30 readOnly: true, 30 readOnly: true,
31 allowDeselect: true, 31 allowDeselect: true,
32 messgroesseStore: null, 32 messgroesseStore: null,
33 bottomBar: true,
33 34
34 initComponent: function() { 35 initComponent: function() {
35 this.rowEditing = Ext.create('Ext.grid.plugin.RowEditing', { 36 this.rowEditing = Ext.create('Ext.grid.plugin.RowEditing', {
36 clicksToMoveEditor: 1, 37 clicksToMoveEditor: 1,
37 autoCancel: false, 38 autoCancel: false,
40 listeners:{ 41 listeners:{
41 // Make row ineditable when readonly is set to true 42 // Make row ineditable when readonly is set to true
42 // Normally this would belong into a controller an not the view. 43 // Normally this would belong into a controller an not the view.
43 // But the RowEditPlugin is not handled there. 44 // But the RowEditPlugin is not handled there.
44 beforeedit: function(e, o) { 45 beforeedit: function(e, o) {
46 // We are not in a messung window!
47 if (!o.grid.up('window')) {
48 return false;
49 }
50 // We are in a messung window and should check if we can
51 // edit.
45 var readonlywin = o.grid.up('window').record.get('readonly'); 52 var readonlywin = o.grid.up('window').record.get('readonly');
46 var readonlygrid = o.record.get('readonly'); 53 var readonlygrid = o.record.get('readonly');
47 if (readonlywin == true || readonlygrid == true || this.disabled) { 54 if (readonlywin == true || readonlygrid == true || this.disabled) {
48 return false; 55 return false;
49 } 56 }
184 } 191 }
185 }; 192 };
186 this.initData(); 193 this.initData();
187 this.callParent(arguments); 194 this.callParent(arguments);
188 this.setReadOnly(true); //Grid is always initialised as RO 195 this.setReadOnly(true); //Grid is always initialised as RO
196 if (!me.bottomBar) {
197 this.down('toolbar[dock=bottom]').hide();
198 }
189 }, 199 },
190 200
191 initData: function() { 201 initData: function() {
192 if (this.store) { 202 if (this.store) {
193 this.store.removeAll(); 203 this.store.removeAll();

http://lada.wald.intevation.org