This is a migrated thread and some comments may be shown as answers.

get middle mouse click on Custom command button

1 Answer 15 Views
This is a migrated thread and some comments may be shown as answers.
Top achievements
Rank 2
marcus asked on 18 Sep 2019, 06:35 AM


is there a way to overwrite the browsers (chrome and firefox) default behavior for middle or right click on custom buttons in a grid?

We are trying to get the middle mouse click on a custom command button in a grid.

With this line we only get the left mouse click, the middle and right are ignored/use the default browser commands 

command.Custom("Details").Text(" ").Click("showDetails").IconClass("fas fa-eye");

Middle - new tab

Right - context menu

We tryed using JS on the mousedown event but it didn't work and in the "showDetails" method we only get the left mouse button

$('.k-grid-Details').on('mousedown', function (e) {
     if (e.which == 1) {
       alert("middle button");



1 Answer, 1 is accepted

Sort by
Telerik team
answered on 20 Sep 2019, 05:36 PM

Hello Marcus,


This is rather a default browser behavior and not related specifically to Telerik. You can observe the same behavior with a standard <a> element on the page:


However, it is still possible to achieve what you are after using the following configuration:

columns.Command(command => command.Custom("Details")
         .Text("Hello").Click("showDetails").IconClass("fas fa-eye")
         .HtmlAttributes(new { href = "javascript: void(0);",
         oncontextmenu = "return false;" } ));


I hope this will prove helpful. Feel free to give it a try and let me know about the result.


Progress Telerik

Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Asked by
Top achievements
Rank 2
Answers by
Telerik team
Share this question