Alko Alko - 1 year ago 125
jQuery Question

jQuery sortable, on receive unwrap() element

I'm using jQuery Sortable to sort items in connected list. Using receive() event I want to unwrap() element, before is dropped onto list.

<div id="main">


<div id="side">
<div class="element">
<div class="row">Item 1</div>

receive: function( event, ui ) {

connectWith: "#main"

But for some reason as soon as item is dropped onto a #main list, main element is removed.

Answer Source

At that time, ui.item is a child of #main. Unwrapping .element will not remove #main:

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download