How can I do this so that sorting the jQuery user interface, which allows drag and drop between different lists, will also be taken as resetting the parent?
See this example in JSBin for 3 lists, one of which is empty. When dragging any element of a list and dropping it onto the <div> elements that wrap lists (green), I want this element to move to the end of the contained <ul> (red). The sortable update function should also be called automatically. How?
$('.sortable').sortable( { accept: '.sortable li', connectWith: '.sortable,.container', update: function () { alert('done with the moving'); } });
My attempt (not working) is to make the containing <div> inaccessible target as follows:
$('.container').droppable( { accept: '.sortable li', drop: function(event, ui) { ui.draggable.appendTo($(this).find('ul')); } });
source share