Repeater Drag and Drop to Reorder Rows

Hi everyone.
I’m new to Axure. I’ve been testing out features and building little one-off models of features I’d like to wireframe. My current test is doing drag-n-drop reorder on repeater rows. I found older posts about this, and have something that mostly works. I have drag/drop events on a dynamic panel/repeater combo with a sort column that on drop:

  • Calculates the new target row for the dragged row.
  • Deletes the old row data.
  • Adds a new row and sets the sort column based on target row.

This all works, but over time it falls apart. My sort keys are basically row * 10. As I delete/add rows, the sort values get screwy.

My plan was to recalculate all the sort keys after the work is done. I’ve tried:

  • edit rows to update sort in the drop handler (does not work because I don’t seem to iterate over rows here).
  • setting a re-sort flag in the drop handler, firing a loaded event for the repeater, and doing the work there (sorts everything as if it is row 1).
  • setting a re-sort flag in the drop handler, and trying to use the item loaded handler for the repeater.
  • several other things that really make no sense :grinning:

What does work is editing all rows in the drop handler to set the re-sort flag, then using an external button after the fact to trigger a loaded event for the repeater. The loaded event updates sort and resets re-sort.

I think I’m probably hitting some sort of interaction flow issue here. Ideally, I’d like to eliminate the button from this equation.

Maybe someone with more experience can see the issue/suggest a solution. Sample file attached.
Thanks in advance!
Mark

repeater_drag_reorder.rp (80.5 KB)