I am using jQuery context menu plugin by Chris Domigan to appy a context menu. This is how it works:
$('#contacts tbody tr').contextMenu('myMenu1', {
bindings: {
'copy': function(t) {
alert('Trigger was '+t.id+'\nAction was Copy');
},
'delete': function(t) {
alert('Trigger was '+t.id+'\nAction was Delete');
}
},
});
Now I want this context menu to appear on left click instead of right click. I can not find an option in the doc. Any ideas how to do that? Do I have to modify the source?
I know it's old, but i'll answer it anyways ;)
If you want to call ContextMenu on left-click, just change the line:
$(this).bind('contextmenu', function(e) {
into this:
$(this).bind('click', function(e) {
But if You want to capture more events to display ContextMenu, You can add event names after spacebar, according to jQuery .bind() reference.
For instance, if You want to display the menu on left and right click just change the line into this:
$(this).bind('contextmenu click', function(e) {
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With