Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 744363
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T08:58:11+00:00 2026-05-14T08:58:11+00:00

I am using the sortable widget to re-order a list of items. After an

  • 0

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 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T08:58:11+00:00Added an answer on May 14, 2026 at 8:58 am

    I’m pretty sure that sortable doesn’t have any undo-last-drop function — but it’s a great idea!

    In the mean time, though, I think your best bet is to write some sort of start that stores the ordering, and then on failure call a revert function. I.e. something like this:

    $("list-container").sortable({
      start: function () { 
               /* stash current order of sorted elements in an array */
             },
      update: function () {
              /* ajax call; on failure, re-order based on the stashed order */
             }
    });
    

    Would love to know if others have a better answer, though.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using a QTreeWidget to display some simple items. I've set the list sortable
I have a list made as sortable using jQuery UI. The first list item
I'm working with a list whose items are both selectable (using checkboxes) and sortable
I'm using the sortable function in jquery to sequence a faq list. Needless to
i am using this jquery to make a drag and drop sortable list. http://jqueryui.com/demos/sortable/
I am struggling to get a list created by Ember.js sortable using jQuery.ui. The
I have an unsorted list ( UL ) that contains sortable list items (
Im using this .sortable function on my list. My problem is that I want
I have am using a sortable jQuery list. I would like to send the
I'm using sortable to implement a one-dimensional list of widgets. It's working alright, but

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.