Drag and Drop Reorderable Repeater

Just posting this in case anyone finds it useful. It is a repeater that allows drag and drop reordering. One limitation (which you may be able to overcome) is if you have a table of data and allow the user to sort the columns, the drag and drop will no longer work.

Demo
reorderable repeater.rp (288 KB)

5 Likes

Adding delete row capability
reorderable repeater.rp (238 KB)

9 Likes

Easy to understand. My big thank.

Ah that’s great, I see you added the ‘Delete’ option. Awesome thanks

I’m sure it’s obvious, but the reorderable repeater works beautifully until I place the whole thing inside of a dynamic panel (I’m mocking tab content). When I do that, I can drag and drop, but the math is off by about a factor of 2. What am I missing?

Hi @AnneR,

Any of the cases that rely on the y coordinate of the repeater could be affected, once that repeater is inside a dynamic pane. Once a widget gets moved inside a panel, the y coordinate changes—it’s calculated in reference to the dynamic panel, not in reference to the main canvas…

I modified the action in the OnDrag event… it’s the action that calculates the dropindex… previously, it was calculating where to drop it based on the y coordinate of the cursor, minus the y coordinate of the repeater, all divided by the height of the row. I changed it so that it’s also subtracting the y coordinate of the outer dynamic panel.

Not sure if that will completely solve the issue for you, or if there might be something else going on as well, but that would be a place to start.

-skb

1 Like