1

Okay so I have a jQuery UI connected sortable on my page. Everything works good. They are being dynamically created from the database. So I am using an ASP Repeater to populate the ul. This all works great. Now I need to save the updated lists to the database. This has proved to be very difficult.

$(function () {
        $("#include, #exclude").sortable({
            connectWith: ".connectedSortable",
            dropOnEmpty: true,
        });
        $("#include, #exclude").disableSelection();
    });

This is what I have for the jQuery. I think there may need to be more here, but I cannot seem to figure out what it is. We have found a way to loop through the repeater items and get them into a DataBoundLiteralControl, but every time it uses the old order and not the new order.

Any help with this would be greatly appreciated.

1 Answer 1

1
           $("#sortable1 li").each(function (idx, li) {
          var idInputs = $(li).children(".id");
          var nameInputs = $(li).children(".name");//if an ItemName input is used
        $(idInputs).attr("id", "Items_" + idx + "__ItemId");
        $(idInputs).attr("name", "Items[" + idx + "].ItemId");
        //if an ItemName input is used
        $(nameInputs).attr("id", "Items_" + idx + "__ItemName");
        $(nameInputs).attr("name", "Items[" + idx + "].ItemName");
         });

see this link : http://jgibson.com/?p=59

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

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.