Вы можете добавить этот пользовательский плагин
$.widget("xim.singleSelectable", {
options: {
select: null
},
_create: function () {
var self = this;
this.element.addClass('ui-selectable');
this.element.delegate('li', 'click', function (e) {
self.element.find('>li').removeClass('ui-selected');
$(this).addClass('ui-selected');
if ($.isFunction(self.options.select)) {
self.options.select.apply(self.element, [e, this]);
}
});
},
selected: function () {
return this.element.find('li.ui-selected');
},
destroy: function () {
$.Widget.prototype.destroy.apply(this, arguments); // default destroy
}
});
тогда ваш код будет
$( "#selectable" ).selectable({
stop: function() {
$( "li.ui-selected", this ).each(function() {
var index = $( "#selectable li" ).index( this );
alert(index);
});
}
});
Я нашел решение здесь
Как предотвратить множественный выбор в плагине jQuery UI Selectable