Kvaser CanKing GUI Extensions SDK v7.6.1


Kvaser CanKing GUI Extensions SDK / ipc / openExtensionDialog

Function: openExtensionDialog()

openExtensionDialog<TResult, TArgs>(dialogId, id, args?, options?): Promise<ExtensionDialogResult<TResult>>

Opens one of this extension’s dialog routes in a separate CanKing window.

The dialog is rendered from the same bundle as the WorkspaceView, at the route /dialog/{dialogId}, but in its own window so it is not limited to the size of the extension’s pane. The extension supplies only a dialog id — CanKing resolves the calling extension from the window’s origin, so a dialog can never point at anything but its own extension.

Pass the WorkspaceView’s id so the dialog can share state with the pane through the useProjectDataSlice hook. Note that session data slices are loaded once when a view mounts and are not pushed between windows, so use project data slices for state that both the pane and the dialog need to see change.

Type Parameters

TResult

TResult = unknown

Type of the value the dialog passes to closeExtensionDialog.

TArgs

TArgs = unknown

Type of the arguments handed to the dialog.

Parameters

dialogId

string

Identifies the dialog, matching a key in the extension’s dialog registry. Must consist only of letters, digits, - and _.

id

number

The unique id of the WorkspaceView opening the dialog.

args?

TArgs

Optional arguments for the dialog to read with getExtensionDialogArgs. Must be JSON-serializable.

options?

ExtensionDialogOptions

Optional window options.

Returns

Promise<ExtensionDialogResult<TResult>>

The outcome of the dialog. Check completed before reading result — a dialog that was never opened, for example on a CanKing version that predates this API, reports completed: false with a reason.