Prevent drop of some items on sortable?
I have two divs: #column-1 and #column-2.
I use the connectWith option to make items in each column drag-and-
droppable onto the other column and vice versa.
However, there is one item I do not want to allow to be dropped in
#column-1 (only moved within #column-2).
How can I prevent it from being dropped on #column-1?
Thanks,
Tom
Minimal example:
<div id="column-1">
<div class="ok">hola</div>
</div>
<div id="column-2">
<div class="ok">hi</div>
<div class="ok">hello</div>
<div class="only-in-column-2">bye</div>
</div>
<script>
$(window).bind("load",function(){
var els = ['div#column-1', 'div#column-2'];
var $els = $(els.toString());
$els.sortable({
items: '> div',
connectWith: els
});
});
</script>