问题
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