comparison app/controller/Ort.js @ 1329:053bd0cd9744

check the correct grid to avoid editing.
author Raimund Renkert <raimund.renkert@intevation.de>
date Fri, 03 Feb 2017 15:31:49 +0100
parents d312e514875c
children 5c2d6812d85a
comparison
equal deleted inserted replaced
1328:cf73b7d7cf99 1329:053bd0cd9744
21 click: me.deleteItem 21 click: me.deleteItem
22 }, 22 },
23 'ortpanel ortstammdatengrid': { 23 'ortpanel ortstammdatengrid': {
24 edit: me.gridSave, 24 edit: me.gridSave,
25 canceledit: me.cancelEdit, 25 canceledit: me.cancelEdit,
26 select: me.select 26 select: me.selectPanel
27 }, 27 },
28 'ortszuordnungwindow ortstammdatengrid': { 28 'ortszuordnungwindow ortstammdatengrid': {
29 edit: me.gridSave, 29 edit: me.gridSave,
30 canceledit: me.cancelEdit, 30 canceledit: me.cancelEdit,
31 select: me.select 31 select: me.selectWindow
32 }, 32 },
33 'ortpanel map': { 33 'ortpanel map': {
34 featureadded: me.featureadded 34 featureadded: me.featureadded
35 } 35 }
36 }); 36 });
99 } 99 }
100 }); 100 });
101 grid.up('ortpanel').down('button[action=delete]').disable(); 101 grid.up('ortpanel').down('button[action=delete]').disable();
102 }, 102 },
103 103
104 select: function(rowModel, record) { 104 selectPanel: function(rowModel, record) {
105 this.checkEdit(rowModel, record); 105 this.checkEditPanel(rowModel, record);
106 this.buttonToggle(rowModel, record); 106 this.buttonToggle(rowModel, record);
107 }, 107 },
108 108
109 checkEdit: function(rowModel, record) { 109 selectWindow: function(rowModel, record) {
110 this.checkEditWindow(rowModel, record);
111 this.buttonToggle(rowModel, record);
112 },
113
114 checkEditWindow: function(rowModel, record) {
115 if (!Ext.Array.contains(Lada.netzbetreiber,
116 record.get('netzbetreiberId')) &&
117 record.get('netzbetreiberId') !== '') {
118 var grid = Ext.ComponentQuery.query('ortszuordnungwindow ortstammdatengrid')[0];
119 grid.rowEditing.cancelEdit();
120 return;
121 }
122 },
123
124 checkEditPanel: function(rowModel, record) {
110 if (!Ext.Array.contains(Lada.netzbetreiber, 125 if (!Ext.Array.contains(Lada.netzbetreiber,
111 record.get('netzbetreiberId')) && 126 record.get('netzbetreiberId')) &&
112 record.get('netzbetreiberId') !== '') { 127 record.get('netzbetreiberId') !== '') {
113 var grid = Ext.ComponentQuery.query('ortpanel ortstammdatengrid')[0]; 128 var grid = Ext.ComponentQuery.query('ortpanel ortstammdatengrid')[0];
114 grid.rowEditing.cancelEdit(); 129 grid.rowEditing.cancelEdit();

http://lada.wald.intevation.org