Data Processor and Drag-n-Drop in the Grid

I can’t seem to get Drag-n-Drop work with Data Processor. It doesn’t generate any events, whichever mode I tried. I distilled code to a very small sample, could you take a look? If I edit the cell or delete or add row - Data Processor works nicely. But does nothing for drag-n-drop! I have dhtmlxDataProcessor v.2.1 Professional edition build 90226. Thanks!!

1 Like

Are you implementing drag-n-drop inside one grid or between 2 grids? If you are using drag-n-drop inside the same grid dataProcessor should not send any information to the server side because of it can send information about deleting, inserting or editing rows. While drag-n-drop none of those operations occurs. To send information to the server side after drag-n-drop operation you should mark dropped row as edited:
dp.setUpdated(rowId,state,mode) where
rowId - id of row to set update-status for
state - true for �updated�, false for �not updated�
mode - update mode name (insert, delete, update)

To check if drag-n-drop operation was finished you can use “onDrop” event. This event passes the following parameters:
sId - id of the source item;
tId - id of the target item;
dId - id of the dropped item (has sense for mercy drag-n-drop);
sObj - source grid object;
tObj - target grid object;
sCol - index of the column from which drag started;
tCol - index of the column in which drop occurs.
grid.attachEvent(“onDrop”, function(sId,tId,dId,sObj,tObj,sCol,tCol){});

Thank you, marking it updated in onDrop works.