views:

162

answers:

1

Hi there,

I have a sortable list(jquery ui), could you advise if it is possible to implement 'undo/redo' base on sortable?

Imagine that, a item is dragged to a new placeholder, then I click "undo" button and the item will move to its original position. If I click "redo" button and the item will move to that new placeholder.

Maybe someone knows how to do this or maybe something else. thanks in advance.

+1  A: 

After each move (on update), you could store the serialized (or use toArray) order in a variable, and then use that to re-order your items in the event of an "undo." In fact, you could push the serialized data onto an array, giving you the ability to "undo" several times.

Jonathan Sampson
thank you very much.try it now..
blueManta