TCustomContextMenuAction
A custom context menu item. Every condition that is set must hold for the item to be shown; conditions on the host's own data are checked in TFrameEvents.onCustomAction.
type TCustomContextMenuAction = object;
Example
const action: TCustomContextMenuAction = {
key: "send-to-crm",
label: "Send to CRM",
icon: "https://example.com/icon.svg",
extensions: ["docx", "pdf"],
requireSecurity: ["Download"],
};
Properties
| Property | Type | Description |
|---|---|---|
extensions | string[] | File extensions the action is shown for, with or without the leading dot, case-insensitive. Applies to file actions only. |
icon | string | URL of the action icon, or a data: URI. The portal fetches an .svg URL and inlines it, so the icon host must answer cross-origin requests with Access-Control-Allow-Origin (as for TFrameConfig.stylesUrl) and the portal's content security policy must allow the connection; any other image URL is loaded as an image and needs the policy to allow images from its origin. |
key | string | Unique action identifier. Returned as action in TCustomActionEvent. |
label | string | Display label in the context menu. |
requireSecurity | string[] | Access flags of the item's security object that must all be true, for example ["Download"] or ["EditRoom"]. |
roomTypes | RoomType[] | Room types the action is shown for. Applies to room actions only. See RoomType. |
section | TCustomActionSection[] | Sections where the action is shown. If omitted, it is shown in every section. |