Jquery UI Sortable - Get the item being sorted.

Posted by Smickie on Stack Overflow See other posts from Stack Overflow or by Smickie
Published on 2010-05-17T16:44:20Z Indexed on 2010/05/17 16:50 UTC
Read the original article Hit count: 483

Hi,

When using Jquery UI Sortable (which is great by the way) how do you get the item that is currently being sorted.

When you use $(this); it return the actual sortable list, not the current sorted item.

I want to do fancy-pants things with the widget when the user is dragging it around. E.g. Animate it when dragging between two lists.

So how do I get the current item being sorted?

There a little code below just to explain a little more...

$(function() {
    $("#sortable_1").sortable({
        start : function(event, ui){ 
            //get current element being sorted
        },
        stop : function(event, ui){ 
            //get current element being sorted
        }
    }).disableSelection();
});

© Stack Overflow or respective owner

Related posts about jQuery

Related posts about jquery-ui