[jQuery] ajaxForm - Callback

[jQuery] ajaxForm - Callback


I was hoping someone on here could help me out. I am working on a
drag and drop sortable list, where the order of the list is saved via
Ajax whenever a drop occurs.
I need to be able to disable drag and drop for the duration of the
AJAX request, and then reenable drag and drop. I figured I could do a
SortableDestroy() before starting the AJAX request and then
reinitialize the drag and drop when the AJAX call returned. For
testing how the callback functions I tried the following code:
myForm.ajaxSubmit (function () {alert ('test');});
I then experimented with form submissions that succeed or fail.
I discovered that the callback is only fired when the AJAX operation
completes successfully. If something goes wrong (like a 404 or a
server time out etc) then the callback is never fired. This imeans
that if I disabled drag and drop before submitting the form then I
could end up in a situaition where it never gets re-enabled.
What I need to be able to do is make the drag and drop reenable when
the AJAX call completes, regardless of whether or not it is
successful. I couldn't find how to do this in the ajaxForms
documentation. Does anybody have any ideas?