Skip to main content

About ContextMenu

ContextMenu class is used to create a custom context menu for your app. It can be applied to any element or window, so you may create specific menus for any window and elements inside it.

It can't be directly accessed. For more information and examples how to add a context menu to the app, go here.

Adding a context menu to an element:

anyElement.contextMenu = [
...ContextMenu.defaultMenu,
{
"type" : "plain", // type
"icon" : ContextIcons.download, // icon object (svg)
"text" : "Download" // text for label
},
{
"type" : "split",
},
{
"type" : "plain",
"icon" : ContextIcons.close,
"text" : "Close"
},
]

If there's no context menu for element, ContextMenu loop will check the next element in the path.

Example: Element -> Element Holder -> Your App -> Workspace -> Demo

It will loop through path array till it finds any context menu. By default, Demo will have default context menu applied.