How do I duplicate item when using jquery sortable?

后端 未结 6 609
孤街浪徒
孤街浪徒 2020-11-29 20:16

I am using this method http://jqueryui.com/demos/sortable/#connect-lists to connect two lists that i have. I want to be able to drag from list A to list B but when the item

6条回答
  •  抹茶落季
    2020-11-29 20:54

    When using Erez's solution but for connecting 2 sortable portlets (basis was the portlet example code from http://jqueryui.com/sortable/#portlets), the toggle on the clone would not work. I added the following line before 'return li.clone();' to make it work.

    copyHelper.click(function () {
        var icon = $(this);
        icon.toggleClass("ui-icon-minusthick ui-icon-plusthick");
        icon.closest(".portlet").find(".portlet-content").toggle();
    });
    

    This took me a while to figure out so I hope it helps someone.

提交回复
热议问题