Category / Section
How to get the particular widget information in javascript embedded dashboard?
Published:
In JavaScript embedded dashboards, you can obtain data from a widget and process it for the further use cases. This can be achieved using the getWidgetData()
method.
Example
Initialize the external method, which should be invoked once the dashboard is rendered completely.
var instance = BoldBI.getInstance("dashboard"); //Here dashboard implies the embed container id.
instance.getWidgetData("Patient Feedback Details", "callback", dashboardId);
function callback(args) {
// Extract the required value for further use cases.
}
In this example, the
getWidgetData()
method takes three parameters:
- The widget name (e.g., “Patient Feedback Details”)
- The callback function (e.g., “callback”) which needs to be implemented on your side. This function will receive the entire widget details in the argument
args
. - The dashboard ID in which the widget is present.
By implementing this method, you can access the data from the specified widget and use it as needed in your JavaScript embedded dashboard.