I need to find a droppable control when the Draggable stop event is running, and I got an ID. Is this possible? So basically my idea is this: When the "out" function's running, I store the dropId. Then if an item is being reverted, I need to set that old Droppable to accept only the reverted Draggable.
this is part of my code:
var dropId;
$('.droppable').droppable
({
hoverClass: "ui-state-active",
drop: itemDrop,
out: function (event, ui) {
$(this).droppable('option', 'accept', '.draggable');
ui.draggable.zIndex = 6000
dropId = $(this).attr("id");
},
$('.draggable').draggable
({
revert: 'invalid',
cursor: 'move',
zIndex: 5000,
stop: function (event, ui) {
var draggableId = $(this).attr("id");
if (event.reverted) {
// dropID.droppable('option', 'accept', draggableId), something lite this
}
}
});
My itemDrop function basically updates the database, and set this: $(this).droppable('option', 'accept', ui.draggable);
Which is somewhat what I am after for when an item is being reverted.
Hope I am somewhat clear! If not, let me know.
Thanks!