Articles in this section
Category / Section

How to add the widget to the existing pinboard using Javascript based embedding?

Published:

Add a Widget to the existing Pinboard using JavaScript Embedding

In the process of embedding a pinboard using JavaScript, you may find the need to add a widget to the existing pinboard. This article guides you through adding widgets to the existing pinboard using the method addWidgetToPinboard.

Steps to Add a Widget

  1. First, get the instance of the BoldBI by using the getInstance method and passing the embed container id as a parameter.
var instance = BoldBI.getInstance("container"); //container -> embed container id
  1. Next, use the addWidgetToPinboard method to add the widget to the pinboard. This method requires three parameters: dashboardId, widgetId, and widgetName.
instance.addWidgetToPinboard(dashboardId, widgetId, widgetName);

Here, dashboardId specifies the ID of the dashboard on which the widget to be added is presented. widgetId and widgetName are the id and name of the widget that is to be added, respectively.

Example

  1. Open the embedding application project and navigate to BoldBI.create() method and include the respective code to render the pinboard.

    image.png

    Here, I have rendered the pinboard of the name “Pinboard” with two widgets in it, as shown below,
    image.png

  2. I have created a button and implemented the function addWidget() for the on-click functionality, where I have included the addWidgetToPinboard method to add the widget to the existing pinboard.
    image.png

  3. When you perform the click function, the respective widget will get added to the pinboard, like below.

    image.png

Conclusion

By following these steps, you can easily add a widget to an existing pinboard using JavaScript embedding.

References

Was this article useful?
Like
Dislike
Help us improve this page
Please provide feedback or comments
SM
Written by Soundarya Mani Meharan
Updated
Comments (0)
Please  to leave a comment
Access denied
Access denied