You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'd like to do a request to a server before I update my model. I can use beforeCancel for that. If I change args.cancelDrop to true the item won't be moved.
Is there a way to perform an ajax request and wait for the result before leaving the beforeMove function?
@dmr - there is not currently a way to set the cancel flag asynchronously. Seems like making jQuery do the AJAX call sync (async: false) should work, but is generally not a good practice. My best advice would be to potentially take the approach that you expect the AJAX call to succeed and let the move happen. Then, if it fails move the item back to its original index.
I'd like to do a request to a server before I update my model. I can use beforeCancel for that. If I change args.cancelDrop to true the item won't be moved.
Is there a way to perform an ajax request and wait for the result before leaving the beforeMove function?
I thought about
but I know that $.ajax({async:false}) is not waiting for the request to finish.
Does anyone have a solution for this?
Keep up the great work, knockout-sortable is awesome!
The text was updated successfully, but these errors were encountered: