I have a simple Dropzone which accepts Draggables with the class "can_be_dropped". This works fine. But i have a Div with "can_be_dropped" inside another Div that has "can_be_dropped" as the parent.
The Dropzone wont react to the Child Draggable,thats inside a Parentdraggable, if you drop it on the Dropzone.
I created a super simple example Fiddle to show it (i wont get it to react to #itemthree): http://jsfiddle.net/dennismueller/qzyL9/25/
$(".can_be_dragged").draggable();
$("#thedropzone").droppable({
accept: ".can_be_dropped",
activeClass: "ui-state-hover",
hoverClass: "ui-state-active",
tolerance: "touch",
drop: function (event, ui) {
alert('You just Dropped #' + $(ui.helper).attr('id'));
}
});
<div id="thedropzone"></div>
<div class="can_be_dragged can_be_dropped" id="itemone"></div>
<div class="can_be_dragged can_be_dropped" id="itemtwo">
<div class="can_be_dropped" id="itemthree"></div>
</div>
I know for Dropzones theres this "greedy" option (like solved here: Jquery UI - Nested Droppables/Sortables ), but is there a solution like this available for Draggables? Im really stuck here and happy for any hints/help.
Currently i think it has to be solved by some CSS workarounds. But currently theres no way around for me for #itemthree to be a child of #itemtwo. I would be happy if its just a jquery setting.
Short description of the Problem:
The Droppable doesnt react if i drop #itemthree on it which is a child of #itemtwo
#itemtwointo#thedropzone?#itemthreedoesn't drag independently of#itemtwo. So you are also dropping#itemtwowhen#itemthreeis dropped? What alert message do you expect?#itemthreeas draggable. "The jQuery UI Droppable plugin makes selected elements droppable (meaning they accept being dropped on by draggables)." api.jqueryui.com/droppable