How to determin source grid in drag-n-drop events

The event data has three properties: start, source and target. The first two are row ids from the source grid, and the last one is the row id from target grid. The target grid can be determined by the event itself, but how to determine the source? What if multiple different kind of source grids ?

The array property ‘source’ in the data always only has start as its only element.

Thx

You maty attach the drag-n-drop events to the sources grid or to the target grid.

But vice versa, if the event attached to the source, we can’t determin the target. Maybe I didn’t catch you. Could you provide a simple example. Thanks.

There may be many ways to do this but what I do is assign two global variables and use those for source/target:

grid1.events.on(“AfterRemove”, function(removedItem){
grid_last_source = 1;
});

grid2.events.on(“BeforeAdd”, function(newItem){
grid_new_target = 2;
});

Hope this helps …

Thanks Results for your response.
This is a workaround. I use this way to multiselect and d-n-d rows in dhx5.x, and thanks the dhx team, this is solved in dhx 7 with .getCells(). But source/target determination arises.

You are able to detect the source grid object from the beforeRowDrag event
https://docs.dhtmlx.com/suite/grid/api/grid_beforerowdrag_event/
attached to the grid source object
Like:

    gridSource.events.on(“beforeRowDrag”, function(a,b,c){
       console.log(this)
        return false;
    });