2

I am building jQuery UI sortable to store order in the database using serialize and ASP.NET Web Service.

I know how to do it in php, but I am not sure how to do it in ASP.NET... I tried googling with little success.

   $('#mylist').sortable({
        handle: ".handle",
        axis: "y",
        update: function () {
            var order = $(this).sortable('serialize');
            alert(order);
        }
    });

Gives me query string item[]=2&item[]=1&item[]=3&item[]=4

I need to pass that into Web Service, and store the new order into the database.

2 Answers 2

2

what i think is execute the code below

$('#mylist').sortable({
    handle: ".handle",
    axis: "y",
    update: function () {
        var order = $(this).sortable('toArray');
    }
});

which gives array of id's in the order they appear. Now when u save and get this array back do this. //psedocode

for each id in the arrayList
GetElementByid(id); attach to parent UL

at last if u see, the list will be arranged as previous states

Sign up to request clarification or add additional context in comments.

Comments

1

Dave Ward has a series of posts that can start you in the right direction.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.