Context Menu that allows modification of the menu IContextMenuItems and whether it is active
Properties
enabled
readonly
enabled: boolean
Whether the context menu is active
parentElementId
readonly
parentElementId: string
ID of the context menu's parent HTMLElement
Methods
addItem()
addItem(menuItem
): void
Adds an IContextMenuItem to the end of the menu options list
Parameters
• menuItem: IContextMenuItem
The Context Menu Item to add
Returns
void
addItemConfig()
addItemConfig(itemConfig
): void
Adds an IContextMenuItemConfig to the end of the menu options list
Parameters
• itemConfig: IContextMenuItemConfig
The Context Menu Item to add
Returns
void
disable()
disable(): void
Disables the context menu and removes all behavior on the DOM related to that menu
Returns
void
enable()
enable(): void
Enables the context menu and adds all behavior for a context menu. This is required for the context menu to show up when right clicking on an element.
Returns
void
getItem()
getItem(menuItemName
): IContextMenuItem
Retrieves an IContextMenuItem by name
Parameters
• menuItemName: string
Name of the item
Returns
IContextMenuItem
itemExists()
itemExists(menuItemName
): boolean
Checks if an IContextMenuItem exists with the provided name
Parameters
• menuItemName: string
Name of the item
Returns
boolean
Whether an item with that name exists or not
items()
items(): IContextMenuItem
[]
Retrieves all IContextMenuItems in the menu
Returns
IContextMenuItem
[]
removeAll()
removeAll(): void
Removes all IContextMenuItems from the menu options list
Returns
void
removeItem()
removeItem(menuItemName
): void
Removes an IContextMenuItem in the menu options list
Parameters
• menuItemName: string
Name of the item to remove
Returns
void