onDrag event

Hi,

I’ve implemented a drag-and-drop in my grid that simply copies the contents of the source cell into the destination cell. Everything is working great however I am struggling getting the onDrag event to fire when I drop in a destination cell that exists in the same row as the source cell.

onDragIn and onDragOut are firing and returning the correct values for every cell in the grid however I just can not get the onDrag event to fire when I drop the value in a cell in the same row.

How can I get this event to fire?

Thanks!

To be able to catch such type of dnd event, add following line to the grid initialization:

grid._drag_validate = false;

Sorry, I’m a bit unclear about this. I’ve added this line to the grid’s initialization (should this be added before or after the grid is split?). Now, how do I get the grid to fire the onDrag event when I drop the value in the same row as the source?

You can place this line before .init() method.

Example of Grid initialization:

[code]grid = new dhtmlXGridObject(‘gridbox’);
grid.setImagePath("…/codebase/imgs/");
grid.setHeader(“Sales,Book Title,Author,Price,In Store,Shipping,Bestseller,Date of Publication”);
grid.setInitWidths(“50,150,120,80,80,80,80,200”)
grid.setColAlign(“right,left,left,right,center,left,center,center”)
grid.setColTypes(“dyn,ed,txt,price,ch,coro,ch,ro”);
grid.setSkin(“dhx_skyblue”);
grid.setColSorting(“int,str,str,int,str,str,str,date”)
grid.enableDragAndDrop(true);
grid._drag_validate = false;
grid.splitAt(2);
grid.init();
grid.loadXML(“php/get.php”);
grid.attachEvent(“onDrag”,function(sId,tId,sObj,tObj,sInd,tInd){
//sInd - index of source cell
//tInd - index of target cell

    });[/code]