How to move two panels in dashboard to each other's positions on drag-and-drop?

Hello! I want to use a dashboard, in which all panels can be moved around from any position to any other position within the dashboard.

I found a very helpful solution in another post, and modified the code a little. Here’s this snippet. It works well when I move connecting panels. However, if I try to move panels diagonally, the dashboard adds an extra row and pushes one of the panels down. I was wondering if there is a way to move the two panels strictly to their previous positions.

if you want to swap source and target panels try to add autoplace:false and move target panel to source place manually.
check this
lines: 19, 56, 57

1 Like

It works great! Thank you very much!