I am using jquery as shown below.
$(document).ready(function () {
$("#Selectable_Positions").selectable({
selected: function (event, ui) {
dostuff();
}
})
})
It works correctly, however only a left click will trigger the selection event. I'm trying to make it right click. I tried to add the code below and the warning fires, but the selected item does not change.
$(document).ready(function () {
$('#Selectable_Positions').mousedown(function () {
$('#Selectable_Positions').trigger('selectableselected');
alert('foo');
})
})
How can I programmatically change the selected item in the mousedown event function?
change
Updated event name as suggested by Ian below.
I created a jsfiddle showing what I'm trying to achieve, and the triggered event does not fire when I right-click. Does anyone know how to make this work? It would be very helpful
http://jsfiddle.net/Jzjdm/
source
share