DHTMLXContextMenu

How to disable browser context menu from grid’s context menu zone? (After implementing contextmenu in grid, both the context menu are coming i.e. dhtmlxcontextmenu as well as browser’s context menu)

You can add the next code to grid’s init, which must fully block native context menu

dhtmlxEvent(mygrid.entBox,“contextmenu”,function(){
return false;
})

Similar fix already was added to the main codebase, and will be included in next release.

Where should I exactly place this patch of code so that native context menu is completely blocked.
I tried placing it before and after mygrid.init() as below but nothing seems working.

mygrid.init();
dhtmlxEvent(mygrid.entBox,“contextmenu”,function(){
      return false;
});

or
dhtmlxEvent(mygrid.entBox,“contextmenu”,function(){

      return false;

});

mygrid.init();




Hello,


this code should be added after grid initialization. Please add also code that blocks bubbling - possibly this modification will fix the issue:


mygrid = new dhtmlXGridObject(‘gridbox’);
dhtmlxEvent(mygrid.entBox,“contextmenu”,function(e){
(e||event).cancelBubble = true
return false;
})



Hi there,

I wish to ask that where can I put the given patch, before init() ?, after init() ? or some where else ?
I put an alert in the code. Its alertnig it, but not disabling the browser’s default context menu.
I just wish to disable the default context menu and show DHX menu. It was working in the v1.6 but not in 2.
Why is it so ?

Please reply.