I have the following code in jQuery…
$("#sortable2").sortable({
connectWith: '.connectedSortable',
dropOnEmpty: true,
receive: function (event, ui) {
var colNum = $(ui.item).attr("id").replace(/col_/, "");
$.post("/Category/Insert", { title: colNum });
},
the var colNum = $(ui…. )
this gets the id from the item being dragged. I was wondering, is it possible for me to get the id of the container it is being dropped in?
As the dropped item is inside and direct descendant of the container, you can access the container using the
parent()method: