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
If you want to disable non consecutive multiselection but still wish to keep the dragging selection you can do this.
stop: function( event, ui ) {
if( $(".ui-selected, .ui-selecting").length > 1){
var elems = $('.ui-selected, .ui-selecting');
for(var i = 0; i < elems.length - 1; i++){
if($(elems[i]).closest('td').next('td').text() != $(elems[i+1]).text()){
//Non consecutive selection detected
}
}
}
}
It essentially checks if all elements are next to each other.