Adding Multiple Context Menu Entries
- 21 Dec 2023
- 1 Minute to read
- Print
- DarkLight
- PDF
Adding Multiple Context Menu Entries
- Updated on 21 Dec 2023
- 1 Minute to read
- Print
- DarkLight
- PDF
Article summary
Did you find this summary helpful?
Thank you for your feedback
To include multiple entries, return an array of ContextMenuEntry objects and, if using TypeScript, set the return type to ContextMenuEntryInterface[]
by running:
// SampleContextMenuEntryLayer.ts
// ...
public onContextMenu(pos: MouseEventCoordinatesInterface): ContextMenuEntryInterface[]
{
//return the ContextMenuEntryInterface
return [{
name: "Go to Navvis",
icon: "fa-globe",
callback: () =>
{
window.open("https://www.navvis.com")
}
},
{
name: "Go to NavVis Developer Forum",
icon: "fa-quote-left",
callback: () =>
{
window.open("https://support.navvis.com/forums/")
}
}]
}
// ...
Was this article helpful?