Drop and drag between multiple Grids

Hello,

I’ve created 4 grids on a layout.(gridA,gridB,gridC and gridD).
I want to have drag and drop functionality from gridA to gridB, and from gridC to gridD.
Other drag an drops should be not possible (Par example drag from gridA to gridC has to give an alert).

I think I must use event onDragIn, but I can not find how.

Kind regards,

Laurens

I found a solution myself. But I don’t know if it is the best solution :slight_smile:

With setUserData each grid gets an Gridname.

After event onDragIn I use getUserData to get gridname back.
If it is the correct name, return true, else return false.

Regards,

Laurens

You may use the onDrag event:
docs.dhtmlx.com/api__dhtmlxgrid … event.html
it have the “source grid object” and a “target grid object” in the attributes. So you don’t have to use the userData and can block the dragging operations right from this event.