Given two simplest connected sortables,
Problem (updated). when a draggable item le开发者_如何学Pythonaves its container, the container should not accept it back while the item is still being dragged (as if the container is disabled). On the DOM level, the placeholder should not move back to the original container.
How can this be accomplished?
The code in this jsfiddle
is not working as expected, but should be a good starting point.
Maybe this will do...
http://jsfiddle.net/pMYft/15/
$("#origin").sortable({
connectWith: '.destination'
}).disableSelection();
$(".destination").sortable({
connectWith: ".destination",
}).disableSelection();
the origin list can drag to either of the destination lists but not back to itself.
I was working on your code on jsfiddle and i changed it
$("ul").sortable({
connectWith: "ul",
items: "li:not(.ui-state-disabled)",
cancel: "ui-state-disabled",
out: function (e, ui) {
ui.item.addClass("ui-state-disabled");
}
}).disableSelection();
精彩评论