跳到主要内容

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​

PropertyTypeDescription
extensionsstring[]File extensions the action is shown for, with or without the leading dot, case-insensitive. Applies to file actions only.
iconstringURL 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.
keystringUnique action identifier. Returned as action in TCustomActionEvent.
labelstringDisplay label in the context menu.
requireSecuritystring[]Access flags of the item's security object that must all be true, for example ["Download"] or ["EditRoom"].
roomTypesRoomType[]Room types the action is shown for. Applies to room actions only. See RoomType.
sectionTCustomActionSection[]Sections where the action is shown. If omitted, it is shown in every section.