How to prevent multiple selection in jQuery UI Selectable plugin

前端 未结 10 1838
走了就别回头了
走了就别回头了 2020-12-30 00:13

I am using jQuery UI Selectable plugin. I want to select one item at a time. But jQuery UI Selectable plugin allows multiple selection by clicking/ dragging / holding CTRL

10条回答
  •  温柔的废话
    2020-12-30 00:35

    This might be a better solution:

    $('#selectable').selectable({
        selecting: function (event, ui) {
            $(event.target).children('.ui-selecting').not(':first').removeClass('ui-selecting');
        }
    });
    

提交回复
热议问题