Reputation: 123
I have some draggables and a sortable container
when I drag that in to the sortable container I need to get the draggable instance,ie I need to find which draggable element I have dragged in to it.
Now the problem is, I have coded like, when I drag a draggable into the sortable area, it becomes the part of the sortable area.
There is no way to find out which draggable I have dragged in.
Can you guys please help.?
Thanks in advance.
Upvotes: 0
Views: 517
Reputation: 11
This is kind of old, but I solved this by getting the event.target inside the drop function.
$('.my-drop-zone').droppable ({
drop: function(event, ui) {
// item that was dragged
var draggedItem = ui.draggable; //or ui.draggable.attr('id');
// item it was dropped on
var droppedOnItem = $(event.target); //or $(event.target).attr('id');
}
});
Upvotes: 1