Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

JQuery UI Saving Sortable List


        $("#list").sortable({

            update : function () {

                var neworder = new Array();

                $('#list li').each(function() {    

                    //get the id
                    var id  = $(this).attr("id");
                    //create an object
                    var obj = {};
                    //insert the id into the object
                    obj[] = id;
                    //push the object into the array
                    neworder.push(obj);

                });

                $.post("pagewhereyouuselist.php",{'neworder': neworder},function(data){});

            }
        });
 
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #JQuery #UI #Saving #Sortable #List
ADD COMMENT
Topic
Name
7+1 =