PiEmbedActions

Main class for interacting with the embedded pi dashboard. PiEmbedActions serves as the primary entry point for performing various actions within the embedded dashboard. It provides methods to interact with different functional areas of the dashboard (e.g., report editor), enabling seamless control and dynamic interaction. This class can be instantiated by using createDashboard() method.

Constructor

new PiEmbedActions()

Classes

PiEmbedActions

Namespaces

reportEditor

Members

internalReportEditor :ReportEditor

Type:
  • ReportEditor

Methods

(static) createDashboard(iframeId, dashboardUrl) → {PiEmbedActions}

Creates an instance of PiEmbedActions class. This method does not load an instance of the dashboard, it validates and sets the required configuration for the embedded dashboard including its functional areas and features.

Parameters:
NameTypeDescription
iframeIdstring

The unique identifier for the iframe in which the dashboard is embedded.

dashboardUrlstring

The URL for the dashboard.

   https://pi-dev.uk:8224/pi?lang=en_GB&editorDisplayMode=CONTENT
   |____| |_______|  |__|   |__________________________________|
     |        |       |                       |
  Protocol  Host    Port    List of query parameters in key-value format,
                                         separated by `&`

dashboardUrl should include all necessary query parameters to prevent browser reloads when navigating between different functional areas in the dashboard. Most common query parameters (optional):

  • locale: Dashboard language and regional settings (e.g., lang=en_GB).
  • token: Secure access token for authentication (e.g., token=xxx).
  • editorDisplayMode: Editor display mode (e.g., editorDisplayMode=CONTENT). See EditorDisplayMode for more details.
Returns:
Type: 
PiEmbedActions
Example
// Basic example of how to create a dashboard instance and embed a Report Editor:
// 1. Create a dashboard instance, providing a valid iframeId and dashboardUrl.
const dashboard = PiEmbedActions.createDashboard('iframeId', 'https://pi-dev.uk:8224/pi?lang=en_GB&editorDisplayMode=CONTENT');
// 2. Open a specific report in the editor, providing a valid report id.
dashboard.reportEditor.open(2);