Looking at the archives, people have asked this before, but I can''t find a proper answer: How do you get sortable_element to return the dragged (moved) element? I know I can compare the list of elements before and after, but I need to know exactly which element was moved. The problem with comparing the list before and after is that if an element is dragged one element forward or backward, it''s not clear which element was actually dragged. For instance, suppose the ids are 0, 1, 2, 3, 4, 5 Before: 0, 1, 2, 3, 4, 5 After: 0, 1, 2, 4, 3, 5 I can''t tell whether 4 was moved forward or 3 moved backward. Any thoughts? -paul _______________________________________________ Rails mailing list Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails
Hello Paul, Why would that be important ? This is a *sortable* list. If I move 4 to 3, and then change my mind, move 3 to 4 (reversing my prior move, but having two moves in the queue), then what ? Anyway, you''ll probably have to generate your draggables and droppables yourself, and add some JavaScript that will manage a queue of moves. On submit, you''ll need to send that data in a field somehow. Bye ! François Paul said the following on 2005-09-23 13:45:> How do you get sortable_element to return the dragged (moved) element? I > know I can compare the list of elements before and after, but I need to > know exactly which element was moved. The problem with comparing the > list before and after is that if an element is dragged one element > forward or backward, it’s not clear which element was actually dragged.