I am working with jQuery UI Sortable plugin, and applying it to a table. How would I trigger a function when dropping whatever element I am dragging? Something similar to below:
alert($(this).attr('id'));
Full Solution
For this, you have to set the container id's to something_number (something_1, something_2, etc).
$(function(){
$('#sortable').sortable({
placeholder: 'ui-state-highlight',
update: function(event, ui){
var order = $('#sortable').sortable('serialize');
alert(order);
}
});
$("#sortable").disableSelection();
});