jQuery sortable: Revert changes if update callback makes an AJAX call that fails?

Posted by Seth Petry-Johnson on Stack Overflow See other posts from Stack Overflow or by Seth Petry-Johnson
Published on 2010-04-23T16:09:42Z Indexed on 2010/04/23 16:13 UTC
Read the original article Hit count: 241

Filed under:
|

I am using the jQuery sortable() feature to re-order a list of items. After an item is drug to a new location, I kick off an AJAX form post to the server to save the new order. How can I undo the sort (e.g. return the drug item to its original position in the list) if I receive an error message from the server?

Basically, I only want the re-order to "stick" if the server confirms that the changes were saved.

© Stack Overflow or respective owner

Related posts about jquery-sortable

Related posts about jquery-ui