2
I found this code on the Internet and I’m studying how it works, to try to adapt in a system, I’ve already managed to get the id of the parent element, the id from the LI that I clicked is not coming right, and I need you to show me the element to which he was dragged.
In short, he must show me in alert the id of the main box, the id clicked, and the id from the box I dropped.
http://fxcomp.com.br/teste.html
<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>
You can edit the question by placing the code you already have that is in error?
– Eduardo Silva
I edited Eduardo, actually not giving error, I can not get the clicked id
– Marcos Paulo