Articles in this section
Category / Section

How to Add Custom Icons and Buttons to Embedded Dashboard Designer?

Published:

Integrating custom icons and buttons into the Bold BI Dashboard Designer enhances the functionality and user experience of the embedded dashboard designer. This article provides a step-by-step guide on how to add custom icons and buttons to the dashboard designer toolbar using JavaScript embedding techniques.

Adding Custom Icons to the Dashboard Designer Toolbar

To add custom icons to the dashboard designer toolbar, follow these steps:

  1. In your application’s code, locate the BoldBI.create() method.
  2. Add the beforeDesignerToolbarIconsRendered event to the dashboardSettings JavaScript API member.
  3. Within the event function, use JavaScript to add the icon as shown in the example code below:
this.dashboard = BoldBI.create({
    mode: BoldBI.Mode.Design,
    dashboardSettings: {
        beforeDesignerToolbarIconsRendered: function (args) {
            args.toolbarIcons.push({
                class: 'su-without-comment',
                iconType: 'custom',
                iconTooltip: 'Comment',
                label: 'Comment'
            });
        }
    }
});
this.dashboard.loadDesigner();

To enable click functionality for the custom icon, use the toolbarClick event within the same BoldBI.create() method:

dashboardSettings: {
    toolbarClick: function (args) {
        if (args.click == "Comment") {
            // Implement the desired operation for when the Comment icon is clicked.
        }
    }
}

Before adding Icon:
image.png

After adding Icon:
image.png

Adding Custom Buttons to the Dashboard Designer Toolbar

To add a custom button to the dashboard designer toolbar, follow these steps:

  1. In the BoldBI.create() method, include the beforeDesignerToolbarButtonsRendered event as shown in the example code below:
dashboardSettings: {
    beforeDesignerToolbarButtonsRendered: function (args) {
        args.toolbarButtons.push({
            class: 'new-btn-class',
            elementId: 'new-button-id',
            label: 'Custom Button',
        });
    }
}
  1. To add click functionality to the new button, utilize the toolbarClick event as shown in the example code below:
dashboardSettings: {
    toolbarClick: function (args) {
        if (args.click == "Custom Button") {
            // Implement the desired operation for when the Custom Button is clicked.
        }
    }
}

By following these steps, you can successfully add custom icons and buttons to the Bold BI Dashboard Designer toolbar, providing additional functionality tailored to your application’s needs.

Before adding button:
image.png

After adding Button:
image.png

Additional 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