How to create your own Save or Publish dialog for Designer in Javascript embedding
In Javascript-based embedding, there are methods for creating categories, getting categories, and saving dashboard actions. With the help of these methods, you can design your prompt and bind actions to your UI. This section explains how to create your own Publish or Save prompt with the necessary steps to use in your designer embedding.
A Publish or Save dialog has been created and used in the dashboard designer embedding. Follow the provided steps to apply it in your environment.
Steps to follow for customizing the publish dialog in designer embedding
-
Provide the details of your embed properties in the
EmbedProperties.cs
file, and then proceed to run your application.
RootUrl Dashboard Server BI URL (ex: http://localhost:5000/bi, http://demo.boldbi.com/bi) SiteIdentifier For Bold BI Enterprise edition, it should be like site/site1. For Bold BI Cloud, it should be empty string. Environment For Bold BI application environment (if Cloud, it should be like `cloud`, if Enterprise, it should be like `enterprise`) DashboardId Dashboard id which you want to render in the applciation. UserEmail UserEmail of the Admin in your Bold BI, which would be used to get the dashboards list. EmbedSecret Get your EmbedSecret key from the Embed tab by enabling the Enable embed authentication
in the Administration page -
To open your own Publish dialog, use the
actionBegin
event when creating the Bold BI object as shown below.
-
When clicking the
Publish
button in the designer, the actionBegin event will be triggered with the type value set asPublishAsAction
. The dialog has been created using EJ2 controls such as Dropdown, Textbox, and Button.
-
To retrieve the categories information, including the category name and category ID, the
getDashboardCategories()
method is called as shown below. For further details, refer to getDashboardCategories().
-
Once you receive the category list, bind it to the Drop Down List of the
Select Category
, and it will be displayed as a selection option.
-
A new pop-up has been created for creating a new category, which will appear when clicking the
add
icon in the publish dialog.
-
Get the inputs for the
category Name
andDescription
from the create category dialog when creating a new category using thecreateDashboardCategory()
method available in Bold BI. For more information, refer to createDashboardCategory().
-
To save or publish the dashboard with the provided details, you should call the
saveDashboard()
method and pass thedashboardName
,categoryId
,categoryName
, anddescription
as parameters. For additional information, refer to the saveDashboard().
-
Now, your new dashboard will be published in a respective category. The same method will be used to
publish
the existing dashboard and topublishAs
the new dashboard as an extension of the existing one.