I've got a list of movies in my sortable, and whilst I don't have them
numbered, I do have a save button that gets the IDs of each movie in
the new order, and then calls an Ajax function to save these.

Have a quick look at
http://groups.google.com/group/jquery-en/browse_thread/thread/bf1a4d6c333db4d8/eba2691f564e76fa
for my structure.

The save button function uses the SortSerialize function and some
regExp to get a comma-delimited list of the movie IDs and sends it to
a generic webservice:
$("[EMAIL PROTECTED]").click(function(){
  var serial = $.SortSerialize();
  //alert( serial );
  var idList = serial.hash.replace(/sortableList\[\]=/gi,'').replace(/
\&/g,',');
  //alert( idList );
  var collectionId = new String( $("[EMAIL PROTECTED]
$=hiddenCollectionId]").val() );
  if (collectionId != "undefined") {
        $.ajax({
          type: "GET",
          url: "Handlers/Movies.ashx",
          dataType: "html",
          data: "action=savecollection&overwrite=true&collectionId=" +
collectionId + "&iList=" + idList,
          success: function(msg){
                $("span#updatemsg").html( msg );
          }
        });
  }
  return false;
});

Reply via email to