Drag and drop setup not working properly
Hello all.
Let us assume we have the following tree-like ul>li>div structure
- <ul>
<li class="class" id="someid1">
<div></div>
<ul>
<li class="class" id="someid2">
<div></div>
<ul>
<li class="class" id="someid3">
<div>></div>
</li>
</ul>
</li>
</ul>
</li>
</ul>
Now, i have the following code:
- $('li .class').droppable(
{
accept: '.someotherclass',
drop: function (event, ui) {
var id_i_want = $(this).data('id');
}
})
Every time i am in that drop function, however, i get the top level li id in id_i_want. Please help me improve the jquery selector on which to apply the droppable. I only have one mention to make, that the tree-like structure CANNOT be modified in any way, no class name change, no nothing.
Thank you,
Silviu