jQuery UI sortable: How to exclude items from connected lists?

帅比萌擦擦* 提交于 2019-12-11 12:13:59

问题


I have two lists (left/right coloumn) which are connected, so I can drag&drop items from one column (left) to the other (right).

How can I exclude specific items from list1 (left) that should NOT be draggable to list2 (right) while keeping the functionality to drag&drop them inside their source-list?

Fiddle: http://goo.gl/7ZKfrl


回答1:


I used the following and it worked for me. Had same requirement.

$("ul#YourLeftListID li").each(function () {
            if ($(this).text() == 'None') {
                $(this).draggable({ disabled: true })
            }
        });

Hope this helps.



来源:https://stackoverflow.com/questions/27408661/jquery-ui-sortable-how-to-exclude-items-from-connected-lists

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!