javascript - JQuery UI Sortable - Nested Sortable Divs connectWith -
javascript - JQuery UI Sortable - Nested Sortable Divs connectWith -
i'm using jquery ui sortable seek have grouping of sortable divs, potentially divs have sortable applied them. , these sortables should able move items between each other.
i'm able items in parent sortable div children sortable divs, can't items children parents.
is possible?
<div id="block-container"> <div class="block">block1</div> <div class="sub-wrapper"> <div class="block-sub-container"> <div class="block"></div> <div class="block"></div> </div> </div> </div> $('#block-container').sortable({connectwith: ".block-sub-container"}); $('.block-sub-container').sortable({connectwith: "#block-container"});
here i'm working with: http://jsfiddle.net/5pm24/
you can see outside items can dragged black boxes, 1 time there cannot brought out.
i want .block .block-sub-container move straight under #block-container.
in fact works fine, set float:left
.block
causing parent #block-container
shrink empty size. because did not set explicit size parent. if don't want set explicit size, think can set overflow:auto
, problem solved.
#block-container { /* set border see boundary */ border:1px solid black; overflow:auto; }
demo. although overflow:auto
helps showing border wrap contents looks drag , drop not work expectedly when drop item within border bounds. best solution fixing size of container, prevent flickering while dragging , dropping. test this demo see difference.
javascript jquery-ui
Comments
Post a Comment