Skip to main content

open

plugin.dynamicPanel.open(panelId: string, title: string, html: string, opts?: DynamicPanelOpenOptions): Promise<DynamicPanelOpenResponse>

Opens a new DynamicPanel with the given HTML content.

When opts.waitForResponse is true the call blocks until the panel iframe sends a { type: 'submit', data: {...} } message via window.parent.postMessage(). The resolved value then contains the submitted data.

Parameters

ParameterTypeRequiredDescription
panelIdstringYesUnique identifier for the panel
titlestringYesHuman-readable panel title shown in the tab
htmlstringYesFull HTML document rendered inside the panel iframe
optsDynamicPanelOpenOptionsNoOptional: waitForResponse, timeout

Returns

Promise<DynamicPanelOpenResponse>

Example

import plugin from '@codebolt/plugin-sdk';

const result = await plugin.dynamicPanel.open('panelId', 'title', 'html');
console.log(result);