Skip to main content

action

Custom application action. Used by the built-in menuButton, custom toolbar items, and custom context-menu entries to surface app-level events. Has no built-in store handler - the dispatch is forwarded to the onaction prop and to any handler registered via api.on("action", ...).

Usage

type ActionPayload = { id: string; [key: string]: any };
FieldTypeDescription
idstringIdentifier of the custom action (e.g. "menu-button", "export-pdf").
[key: string]anyOptional extra payload fields forwarded as-is to handlers.

action is not part of the typed StoreActions map. Calls to api.exec("action", ...) are routed to onaction and on("action", ...) listeners only.

Trigger

api.exec("action", { id: "export-pdf" });

Observe

api.on("action", p => console.log("action:", p.id));

Intercept

api.intercept("action", p => p.id !== "blocked");

Component handler

<Calendar :onaction="p => console.log('action:', p.id)" />
  • toolbar — items that dispatch action (e.g. menuButton).
  • exec — programmatically fire a custom action.
  • on — register a handler for "action".
  • Navigation bar — wiring custom toolbar buttons.
  • Context menu — forwarding custom menu ids as actions.