I have two lists of items sortable, and connectWith each other.
One list is all Item in DB call AllGroup
The other is list of items i must add for something, call InGroup
I want to can drag items from AllGroup
and drop in InGroup
and clone it, but can't drag items from InGroup
to AllGroup
.
My Code:
Html:
<div class="allgroup">
<ul id="sortable1" class="connectedSortable sort-group">
<li class="ui-state-default">Item 1</li>
<li class="ui-state-default">Item 2</li>
<li class="ui-state-default">Item 3</li>
<li class="ui-state-default">Item 4</li>
<li class="ui-state-default">Item 5</li>
</ul>
</div>
<div class="ingroup">
<ul id="sortable2" class="connectedSortable sort-group">
<li class="ui-state-highlight">Item 1</li>
<li class="ui-state-highlight">Item 2</li>
<li class="ui-state-highlight">Item 3</li>
<li class="ui-state-highlight">Item 4</li>
<li class="ui-state-highlight">Item 5</li>
</ul>
JS:
$( ".sort-group" ).sortable({
connectWith: ".connectedSortable"
}).disableSelection();
});
$('#sortable1').sortable({
helper: 'clone'
});
$('#sortable1').disableSelection();
How can do it? I try some code but not success.