showAt()
shows a context menu
showAt(elem: HTMLElement | MouseEvent | string, showAt: "bottom" | "right"): void;
Parameters:
elem: HTMLElement | MouseEvent | string
- a master HTML element (or its id) or the mouse event that will trigger the context menushowAt: string
- a place where the context menu will be shown relative to the element
Example
const cmenu = new dhx.ContextMenu();
document.querySelector('#menu').oncontextmenu = function(e) {
e.preventDefault();
cmenu.showAt("menu", 'right');
}
Related sample: Menu. Show at (right, bottom, under the mouse cursor)
note
This is the method of Context Menu.