views:

453

answers:

1

When using Sortable.create I can't seem to get the element that is being dragged. Does Sciptaculous not fully implement all Draggable and Droppable features when you use sortable?

Given:

Sortable.create("sortArea", {scroll:window, onChange:orderLi});

function orderLi(){
    console.log(this.draggables.each(function(e){if(e.dragging==true){return e};}));
}

My console always shows all the array of draggables. How do I only grab the one that is being dragged?

A: 

The onChange function actually gets a handle to the element passed in.

Sortable.create("sortArea", {scroll:window, onChange:orderLi});

function orderLi(elementBeingDragged){ console.log(elementBeingDragged); }

Joe Zack
When I do that it reports the container in the console not the element I'm dragging.
Tom