Skip to content

onBeforeContextMenu

fires before the context menu is called in the item area

function onBeforeContextMenu(
// the id of the clicked item
id: string,
// a native event object
e: Event,
// the target HTML element
node: HTMLElement
): boolean

boolean returning false will block the event

grid.attachEvent("onBeforeContextMenu", function(id, e, node){
if (some_check(id))
return false; // blocks the context menu
else
return true;
});

Returning false from the event handler will block further processing.