I have a drag and drop code that works fine. Just make a small request. I noticed that if I add a warning to the drop function for debugging purposes (for example, alert (draggedItem.text ());) it triggers a warning twice when I drop something into the drop area. I read in another post that using droppable and sortable together triggers this strange double event. But I need to use the droppable event to get the object of the draggable object (ui.draggable) - this means that I can manipulate it when I drop it. If there is another way to get a draggable object, tell me :) Also, if you have an explanation why this happens, that would be interesting ...
$(".field > li").draggable({ helper:'clone', opacity: 0.4, connectToSortable:'.dragrow' }); $(".dragrow").droppable({ drop: function(e, ui) { draggedItem = ui.draggable;
I also have another request related to this, but since my code is quite large, I cannot post all the information here. Therefore, I understand that if you canβt help - simply, if something comes to mind, that would be great. Basically, I have a list of "blocks" that I can drag into multiple lines. Individual rows can be hidden using a switch event. If I have 3 rows, I can drag and drop blocks into any of them. If I then hide the first one, I can no longer drag to the other two lines. I can still sort them. And as soon as I start sorting them, I can drag them into them again. Weird ...
jquery double jquery-ui-sortable draggable droppable
Wasted space
source share