I am working with jquery ui sortable. I would like to get the sorting array to pass it to the handling file on drop event.
one funny thing i found.. http://jsfiddle.net/7Ny9h/
$(function() {
$( "#sortable" ).sortable();
$( "#sortable" ).disableSelection();
$( "#sortable li" ).droppable({
drop: function( ) {
var order = $("#sortable").sortable("serialize", {key:'order[]'});
$( "p" ).html( order );
}
});
});
Seeing the sample, if I move BOX No.2, the BOX 2 is left out of the array.
Perhaps I need a kind of "dropend" event because it seems that jquery ui drop event doesn't count the dragged and dropped one.
You can also use update
to detect it.
$( "#sortable" ).sortable({
update: function( ) {
// do stuff
}
});