Loading...
Loading...

Live Chat Icon For mobile
Hugo Morris

Chat with the Bold BI Sales team now!

Live Chat Icon
Event Handling > Linking to Dashboard
Linking to Dashboard
This sample describes linking to a dashboard page through its URL, passing filter parameters from a widget in the embedded dashboard through user interaction.
How can you explore?
The URL Parameters window shows the parameter and its value passed from the user's interaction with Open positions by department widget in the current dashboard. To explore the Linking Dashboard functionality, interact with the Pie Chart widget titled Open positions by department. Now, the URL parameter will be framed with the department column and the selected value and let you navigate to the linked dashboard along with the URL parameter passed and applied as a filter.
Properties

Code snippet that enables this functionality.


    function renderDashboard() {
        var boldbiEmbedInstance = BoldBI.create({
            serverUrl: rootUrl + siteIdentifier,
            dashboardId: dashboardId,
            embedContainerId: "dashboard-container",// This should be the container id where you want to embed the dashboard
            authorizationServer: {
                url: "http://localhost:8080/embeddetail/get"
            },
            beforeNavigateUrlLinking: function(args) {
                $("#target-dialog").html("");
                args.cancel = true;

                // creating a div element specifically for a dialog popup.
                $('body').append(
                    $('<div>').attr('id', 'target-dialog').append(
                        $('<div>').attr('id', 'dialog-container')
                    )
                );
                var dialogContent = document.createElement("div");
                dialogContent.id = "urlLink-content";

                // Create a popup dialog box to display a url linking dashboard.
                var dialogContent = new window.ejs.popups.Dialog({
                    isModal: true,
                    showCloseIcon: true,
                    target: document.getElementById("target-dialog"),
                    content: dialogContent.outerHTML
                });
                dialogContent.appendTo('#dialog-container');

                // Retrieve the linking parameter and its corresponding value of the widget column to form url parameter.
                var filterValue = args.linkInfo.parameterDetails[0].parameter + " = " + args.linkInfo.parameterDetails[0].value;
                var urlLinking = BoldBI.create({
                    serverUrl: rootUrl + siteIdentifier,
                    dashboardId: dashboardId,
                    authorizationServer: {
                        url: "http://localhost:8080/embeddetail/get"
                    },
                    embedContainerId: "urlLink-content", // This should be the container id where you want to embed the dashboard
                    filterParameters: filterValue // The url parameter which was retrieved from the linking information.
                });
                urlLinking.loadDashboard(); // Load the dashboard in the dialog popup.
            }
        });
        boldbiEmbedInstance.loadDashboard();
    }