Hello,
So I have 2 grids, with a drag and drop event set in between.
The idea is, depending on the state of the element owning those grids, the DnD functionnality should be disabled. I do not wish to alter the code inside the “onDrag” an other defined events, because the disabling functions have to be able to be called from outside.
Anyway…
First, I stored in an array every event used, in order to call a detachEvent uppon it.
Then, I coded a “readOnly()” function with this :
[code]
this.grid1.setEditable(false);
this.grid2.setEditable(false);
this.grid1.forEachRow(function(pRow){this.lockRow(pRow,true);});
this.grid2.forEachRow(function(pRow){this.lockRow(pRow,true);});
for(var i in myEvents){
try{this.grid1.detachEvent(myEvents[i]);}catch(e){}
try{ this.grid2.detachEvent(myEvents[i]);}catch(e){}
}
this.grid1.enableDragAndDrop(false);
this.grid2.enableDragAndDrop(false);[/code]
As a result, the instructions depending on the drad and drop functions are not coded, which is nice, but my row from grid1 is still visualy dropped in grid2.
I hope I’m clear enough…
Any idea ?