Allowing Right Click to perform default browser behavior

I have experimented with the context menu available for right clicks and gotten it to work. Following shows a snippet:

    var menu = new dhtmlXMenuObject("foo");
    menu.attachEvent("onClick", function(){ console.log('onClick!');return true;});
    menu.loadXMLString('<menu id="0"><item text="Red" img="red.gif" id="edit_Red"/><item text="Green" img="green.gif" id="edit_Green"/><item text="Blue" img="red.gif" id="edit_Blue"/><item text="Other..." img="" id="outher"><item text="Yellow" img="red.gif" id="edit_Yellow"/><item text="White" img="green.gif" id="edit_White"/></item></menu>');
    GRIDNAME = new dhtmlXGridObject('GRIDNAME');
    console.log('~~~doc ready -> menu:'); console.log(menu);
    GRIDNAME.attachEvent('onRightClick', function(id, ind, ev) {
                                 return true; // as example, though this actually calls a function

Sweet! Many smiles that it’s this easy to use and thank you!

However, my company wishes to enable the default browser behavior for right clicks. The ability to copy links, open links in new tabs, copy text, etc. is all crucial for our information needs within the tables produced via dhtmlxgrid.

I have not been able to find a way to do this and I have poured over the docs and forum looking for one; perhaps I am missing something simple so I thought I would ask a dumb question.

We use the Pro edition of grid. Is there a simple way to turn off the event capturing that seems to take place no matter what gets returned in onRightClick event? Is there some way to override the library’s effect and just let the browser do the work?

Unfortunately it’s not to show a default context menu in dhtmlxgrid in case of enabled context menu on the base of dhtmlxMenu.

Thank you for your reply, sematik.

I think I understand. So the context menu must be enabled independently from the grid and then populated by a function that is called in the onRightClick function definition? Might you have a working example of links that are right-clickable in a menu?

Or have I misunderstood all together?

>Unfortunately it’s not to show a default context menu in dhtmlxgrid
The solution is to not use contextMenu at all? I would say that is fortunate except I don’t quite understand when you say:

>in case of enabled context menu on the base of dhtmlxMenu.


calcMenu(menu);// some function to disable context menu on the base object?


Would this get me closer? I would love to skip the context menu and simply enable the default browser behavior on right clicks in dhtmlxgrid tables. I may have been mistaken in assuming dhtmlxMenu is the way to accomplish that. I hope this makes sense. Any insights would be greatly appreciated.

unfortunately the browser default context menu usage is not available in case of using the dhtmlx context menu.
You will have to use the default browser context menu (and refuse te dhtmlxMenu context usage), or use the dhtmlxMenu context but without the default browser context menu in your grid.