2

I'm using JQqueryUI sortable and was wondering if it would be possible to not remove the a list item from the original list whilst dragging and dropping onto a new list. For example, if Sortable#1 is the original list, and I drag and drop Item 1 onto Sortable#2, I want Item 1 to still be displayed in Sortable#1 (as well as Sortable#2), however, you should not be able to add it to Sortable#2 again until it is dropped back to Sortable#1. Are there any such tutorials out there I can refer to? Thanks in advance.

$(function() {
        $( "ul.droptrue" ).sortable({
            connectWith: "ul"
        });

        $( "ul.dropfalse" ).sortable({
            connectWith: "ul",
            dropOnEmpty: false
        });

        $( "#sortable1, #sortable2" ).disableSelection();

});

-

<ul id="sortable1" class='droptrue'>
    <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>

<ul id="sortable2" class='drop true'>
    <li class="ui-state-highlight">Item 1</li>
    <li class="ui-state-highlight">Item 2</li>
    <li class="ui-state-highlight">Item 6</li>
</ul>
4

0 回答 0