API Reference for Designer Events in JavaScript
onActionStart
This event will be triggered at the beginning of every viewer action, including connection, layout and dashboard rendering, popup opening and closing, refreshing, filtering, exporting, and more.
| Name | Type | Access | Description |
|---|---|---|---|
| eventType | get | Will hold the current event type that triggered the event | |
| source | get | This will contain the data related to the current event as like below. 1. data 2. element |
|
| source.element | object | get | Holds the current event site UI element. If there involves no UI element will be returned as null |
| source.data | object | get | Holds the current event data. |
Example
var dashboard = BoldBI.create({
events: {
onActionStart: function (args) {
if (args.eventType === "clearAllFilter") {
// Write a code block to perform any further actions.
}
}
}
});
dashboard.loadDashboard(); Event Types
| Event Types | Description |
|---|---|
| renderLayout | This event will trigger when the layout of the dashboard started to render. |
| renderDashboard | This event will trigger when the dashboard started to render. |
| renderWidget | This event will trigger when the widget started to render. |
| resizeDashboard | This event will trigger when we invoke the resize dashboard method or when you resize the browser window. |
| exportDialogOpen | This event will trigger when the export dialog box opens, when you click on the export option in the context menu. |
| exportDialogClose | This event will trigger when the export dialog box closes. |
| maximizeDialogOpen | This event will trigger when the Maximize dialog box opens, when you click on the Maximize icon in the widget header. |
| maximizeDialogClose | This event will trigger when the Maximize dialog closes. |
| filterOverViewOpen | This event will trigger when the filter overview drop-down opens. |
| filterOverViewClose | This event will trigger when the filter overview drop-down closes. |
| clearFilter | This event will trigger when you clear the individual filter in the filter overview. |
| clearAllFilter | This event will trigger when you clear all the filters in the filter overview drop-down. |
| clearWidgetFilter | This event will trigger when you clear the filter in the widget. |
| exporting | This event will trigger when the dashboard exporting gets started. |
| datasourceConfiguration | This event will trigger when the datasource icon is clicked. |
onActionComplete
This event will be triggered once all viewer actions have been completed.
| Name | Type | Access | Description |
|---|---|---|---|
| eventType | get | Will hold the current event type that triggered the event | |
| source | get | This will contain the data related to the current event as below. 1. element 2. data |
|
| source.element | object | get | Holds the current event site UI element. If there involves no UI element will be returned as null |
| source.data | object | get | Holds the current event data. |
Example
var dashboard = BoldBI.create({
events:{
onActionComplete: function (args) {
if (args.eventType === "clearFilter") {
// Write a code block to perform any further actions.
}
}
}
});
dashboard.loadDashboard(); Event Types
| Event Types | Description |
|---|---|
| layoutRendered | This event will trigger after the layout rendering is completed. |
| dashboardRendered | This event will trigger after the dashboard rendering is completed. |
| viewDataDialogOpen | This event will trigger when the ViewData dialog box opens, when you click on the ViewData option in the context menu. |
| viewDataDialogClose | This event will trigger when the ViewData dialog box closes. |
| exporting | This event will trigger when the dashboard exporting gets started. |
| exportCompleted | This event will trigger when the dashboard exporting gets completed. |
| clearFilter | This event will trigger when you clear the individual filter in the filter overview and gets completed. |
| clearWidgetFilter | This event will trigger when you clear the filter in the widget and gets completed. |
| Save | This event will trigger once the Publish option is clicked in dashboard designer mode. |
| SaveAs | This event will trigger once the Publish As option is clicked in dashboard designer mode. |
designer
beforeToolbarButtonsRender
This event will be triggered before the toolbar buttons are rendered.
| Name | Type | Description | ||||||
|---|---|---|---|---|---|---|---|---|
| args.toolbarButtons | array[] | Holds the details all the tool bar Buttons.
|
Example For adding new button
var dashboard = BoldBI.create({
mode: BoldBI.Mode.Design,
events:{
designer:{
beforeToolbarButtonsRender: function (args) {
// Write a code block to add an external button before the dashboard banner buttons are rendered.
// args.toolbarButtons.push({
// class:'new-btn-class',
// elementId:'new-button-id',
// label:'External Button',
// });
}
}
}
});
dashboard.loadDesigner(); Example For removing a button
var dashboard = BoldBI.create({
mode: BoldBI.Mode.Design,
events: {
designer:{
beforeToolbarButtonsRender: function (args) {
// Write a code block to remove an existing button before the dashboard banner buttons are rendered.
// args.toolbarButtons.forEach(function (button, index, object) {
// if (button.label == "Preview") {
// object.splice(index, 1);
// }
// });
}
}
}
});
dashboard.loadDesigner(); beforeToolbarIconsRender
This event will be triggered before the designer toolbar icons are rendered. You can add or remove icons in the toolbar using this event.
| Name | Type | Description | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| args.toolbarIcons | array[] | Holds the details of the designer toolbar Icons.
|
Example for adding new icon in designer toolbar
var dashboard = BoldBI.create({
mode: BoldBI.Mode.Design,
events: {
designer:{
beforeToolbarIconsRender: function (args) {
// Write a code block to add an external icon other than boldbi before the designer toolbar icons were rendered.
// args.toolbarIcons.push({
// class:'fa fa-comments',
// iconType:'custom',
// iconTooltip:'Comment',
// label:'Comment'
// });
}
}
}
});
dashboard.loadDesigner(); Example for removing a icon from designer toolbar
var dashboard = BoldBI.create({
mode: BoldBI.Mode.Design,
events:{
designer:{
beforeToolbarIconsRender: function (args) {
// Write a code block to remove an existing icon before the designer toolbar icons are rendered.
// args.toolbarIcons.forEach(function (icon, index, object) {
// if (icon.label == "Undo") {
// object.splice(index, 1);
// }
// });
}
}
}
});
dashboard.loadDesigner(); beforePublishDialogOpen
This event will be triggered by the following actions.
- To
PublishorSavethe new dashboard. - To
PublishAsorSaveAsthe existing dashboards.
| Name | Type | Description |
|---|---|---|
| args.source.data.dashboardId | string | Holds the unique GUID for the dashboard. |
| args.source.data.dashboardName | string | Holds the name of the dashboard. |
| args.source.data.dashboardDescription | string | Holds the description of the dashboard. |
| args.source.data.isPublicDashboard | string | Holds the dashboard is public or not. |
Example
var dashboard = BoldBI.create({
mode: BoldBI.Mode.Design,
events:{
designer:{
beforePublishDialogOpen: function (args) {
//Write a code block to perform an operation before publish the dashboard.
//Write a code block to perform an operation before publish the dashboard.
}
}
}
});
dashboard.loadDesigner(); onToolbarItemClick
This event will be triggered when the designer toolbar icon/button is clicked.
| Name | Type | Access | Description |
|---|---|---|---|
| click | string | get | Holds the name of the icon/button clicked. |
| model | get | Holds the dashboard designer's object. | |
| target | array | get | Contains the parent element of the selected icon/button. |
| type | get | Holds the current event type. | |
| cancel | boolean | set | Holds the cancel value of the current operation. |
Example
var dashboard = BoldBI.create({
mode: BoldBI.Mode.Design,
events:{
designer:{
onToolbarItemClick: function (args) {
// if (args.click == "Copy")
// Write a code block to perform an operation when the Copy icon from designer toolbar is clicked.
// if (args.click == "Preview")
// Write a code block to perform an operation when the Preview button from designer toolbar is clicked.
}
}
}
});
dashboard.loadDesigner(); beforeWidgetsListed
This event will be triggered before the widget item panel is rendered. You will be able to remove a specific group or specific widget item in the item panel using the event.
Note: This event will be triggered again if the preConfiguredWidgets API is enabled.
| Name | Type | Description |
|---|---|---|
| args.widgetInfo | array[] | Holds the details of the widget groups like GroupName and GroupId. |
| args.widgetInfo.Items | array[] | Holds the details of the widget items like id, tooltip, widgetDisplayName and so on. |
Example for removing a existing group
var dashboard = BoldBI.create({
mode: BoldBI.Mode.Design,
events:{
designer:{
beforeWidgetsListed: function (args) {
// Write a code block to remove an 'Comparison' group before the widget panel is rendered.
// args.widgetInfo.forEach(function (group, index, object) {
// if (group.GroupName == "Comparison") {
// object.splice(index, 1);
// }
// });
}
}
}
});
dashboard.loadDesigner(); Example for removing a existing widget from specific group
var dashboard = BoldBI.create({
mode: BoldBI.Mode.Design,
events:{
designer:{
beforeWidgetsListed: function (args) {
// Write a code block to remove an 'Bar' widget before the widget panel is rendered.
// args.widgetInfo.forEach(function (group, gIndex, gObject) {
// if (group.GroupName == "Comparison") {
// group.Items.forEach(function (item, iIndex, iObject) {
// if (item.widgetDisplayName == "Bar") {
// iObject.splice(iIndex, 1);
// }
// });
// }
// });
}
}
}
});
dashboard.loadDesigner(); filters
onInteraction
This event will be triggered once the master widget applying and clearing filters are completed.
| Name | Type | Access | Description |
|---|---|---|---|
| eventType | string | get | Will holds the current event type that triggered the event. |
| model | get | Holds the dashboard viewer's object. | |
| source.data | object | get | Holds the master widget and its filter values details. |
| type | string | get | Holds the parent event type of the current event. |
| cancel | boolean | set | Holds the cancel value of the current operation. |
Example
var dashboard = BoldBI.create({
events:{
filters:{
onInteraction: function (args) {
// Write a code block to operate after a master widget interaction is completed.
}
}
}
});
dashboard.loadDesigner(); properties
DashboardProperties
This section describes the dashboard properties of the viewer object correctly.
| Name | Type | Access | Description |
|---|---|---|---|
| serverUrl | string | get | Hold the Bold BI Server URL. |
| itemId | string | get | Hold the unique id of the dashboard. |
| dashboardDescription | string | get | Hold the description of dashboard. |
| dashboardName | string | get | Hold the name of the dashboard is rendered. |
| environment | string | get | Hold the embedding environment type. |
| mode | string | get | Hold the mode of the dashboard. |