jQuery UI Sortable: Revert changes if update callback makes an AJAX call that fails?
问题 I am using the sortable widget to re-order a list of items. After an item is dragged 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 drag 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. 回答1: I'm pretty sure that sortable doesn't have any undo-last-drop function -- but it's a