jquery-ui - position of a list item when starting drag and drop?

Posted by user246114 on Stack Overflow See other posts from Stack Overflow or by user246114
Published on 2010-06-11T22:46:48Z Indexed on 2010/06/11 22:53 UTC
Read the original article Hit count: 192

Filed under:

Hi,

I am using the jquery-ui library. I have two sortables. I want to know the index of the dragged source item. I have something like this:

$(function() {
    $("#sortable1, #sortable2").sortable({
        connectWith: '.connectedSortable'
    }).disableSelection();

    $("#sortable1").sortable({
        start: function(event, ui) {
            alert(ui.position);
        }
    });
});

if I'm reading the docs correctly, then ui.position should be what I want?:

ui.position - current position of the helper

but when I jsut try printing it: alert(ui.position) it seems to be empty.

I am doing all of this in an attempt to emulate cloning.

docs: http://jqueryui.com/demos/sortable/#event-activate

Thanks

© Stack Overflow or respective owner

Related posts about jquery-ui