Skip to main content

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 menu
  • showAt: string - a place where the context menu will be shown relative to the element

Example

var cmenu = new dhx.ContextMenu();document.querySelector('#menu').oncontextmenu = function(e) {    e.preventDefault();    cmenu.showAt("menu", 'right');}

Related sample: Menu. Show At

note

This is the method of Context Menu.