Drag and drop to re-sort items

I have a grid that is grouped by a column called Name. It is also sorted by a column called Priority. Values in Priority are A01, A02, A03, A04, A05. I would like to be able to drag the row with priority A05 to A02 and change the value in the Priority column from A05 to A02. Then I would like to change the rest of the values below in this group to A03, A04, A05.

I tried to use attachEvent(“on drop”), which gives me the row number I am dropping to, but the row numbers below are not consecutive, so I cannot figure out how to cycle through the rest of the rows in the group to change the values.

Anyone have any ideas on how to do this?

You may try to use the forEachRowInGroup function:

grid.forEachRowInGroup(name,function(id){ //do_something_with_row(id); });