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 8725677
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T08:05:25+00:00 2026-06-13T08:05:25+00:00

The user sorts list objects in the way he wants, then he clicks the

  • 0

The user sorts list objects in the way he wants, then he clicks the link ‘Save’ and the order is saved to the db (with the help of the url). Before the user changes the order the url looks as this: index.php?type=list&action=saveNewListOrder&listId=24.

When the user changes the order of the list objects the function below runs, and creates a string of the list object that is merged with the url.

Everything works fine except that the second time the user moves a list object the url that’s retrieved already contains the string with the list objects (since the last move). Every time the user moves a list object the url grows.

After the third move the url can look like this:

index.php?type=list&action=saveNewListOrder&listId=170&listOrder=772.773.775.774
.776&listOrder=772.775.773.774.776&listOrder=775.773.772.774.776

I have thought of using substring (to extract the first part of the url) and also of putting the url in a hidden field that’s retrieved every time and never changes. Both of these solutions feels unnecessary complicated, and there must be a more elegant solution.

    $('#listElements').sortable({
        update: function(event, ui) {

            var order = '';
            var i = 0;
            $('.listObject li').each(function (e) {
                if (i != 0) {
                    order += '.';
                }
                order += $(this).attr('id');//.push($(this).attr('id'));
                i +=1;
            });

            var url = $('#newOrder').attr("href");

            url += "&listOrder=" + order;

            $('#newOrder').attr('href',url);
        }
    });
  • 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-06-13T08:05:26+00:00Added an answer on June 13, 2026 at 8:05 am

    why don’t you just save the list order in a variable until the user actually hits save. then append it to the url.

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

Sidebar

Related Questions

say I display a datatable on a datagridview, then the user sorts it, and
I want to sort list items by their priority, which the user types in,
I am iterating through a List of custom data objects and outputing the data
I want to allow the user to sort objects left-to-right with a scroll bar.
In my code I have a List<Person> . Attributes to the objects in this
Let's assume I have a keyspace with a column family that stores user objects
Im declaring from a big list of custom, multiple level, objects (here called venueCounter)
I have 2 list objects, one is just a list of ints, the other
I'm making a generic template that will be displaying a list of objects from
I know I can use something like User.sort {|a, b| a.attribute <=> b.attribute} or

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.