only My site

Tuesday, August 16, 2011

JQuery - Found Solution for Nested Droppable items

http://www.designerstalk.com/forums/programming/64268-jquery-droppable-div-created-fly-not-working.html#post777326


$(".myDropClass").droppable(
{
accept: '.myDragClass',
drop: function (event, ui) {
//remove old item
alert('Dropped');
$(this).find(".myDragClassPlaceHolder").remove();

var listHtml = "
  • " +
    "
    " +
    "New Droppable area" + ui.draggable.text() + "
  • ";
    alert('Added1');
    $(this).append(listHtml);
    alert('Added');
    $(this).find('#ontheflyDiv').droppable({
    drop: function(event, ui)
    {
    alert('Set the droppable behavior to the newly created element');
    $(this).append("hello");

    }
    });

    }
    });

    No comments: