I found this code on the internet and I am studying how it works, to try to adapt in a system, I already got the id
of the parent element, the id
of the LI that clicked is not coming right, and I need me show the element to which it was dragged.
In short, it should show me in alert
id
of the main box, id
clicked, and id
of the box I dropped.
<script>
$(function () {
$("#items1,#items2,#items3").sortable({
connectWith: "#items1,#items2,#items3",
start: function (event, ui) {
ui.item.toggleClass("highlight");
},
stop: function (event, ui) {
var id_principal = $(this).attr('id');
var id_do_li = $('li').attr('id');
alert('Id Pricipal = '+id_principal+' | Id do li = '+id_do_li);
ui.item.toggleClass("highlight");
}
});
$("#items1,#items2,#items3").disableSelection();
});
</script>