Check documentation for the latest version of dhtmlxSuite onBeforeContextMenu DHTMLX Docs

onBeforeContextMenu

fires before the moment when a context menu appears by the right mouse click

void onBeforeContextMenu(string|number zoneId,Event ev){ ... };

Parameters

zoneIdstring|numberid of the context menu zone
evEventnative window event object

Example

myMenu.attachEvent("onBeforeContextMenu", function(zoneId,ev){
    // your code here
    // returning "true" allows a context menu to be shown, "false" - cancels showing
    return true;
});

Details

The event is cancellable: to show a context menu you need to "return true"

Back to top