Applying Dashboard parameters using APIThe Dashboard Platform SDK provides support to customize the dashboard parameter settings using following APIs.
1.dashboardParameterSettingsThis API is used to show or hide the dashboard parameter icon and apply dashboard parameters. The dashboardParameterSettings has the below two inner level properties, * showIcon * data Where, showIcon: Holds the Boolean value and it is used to show or hide the parameter icon in the Dashboard Viewer. data: Holds the array of value as shown in below table,
Below code snippet is example for passing the value of the parameter: $("#dashboard").ejDashboardViewer({ serviceUrl: 'service URL', dashboardPath:'Path of the dashboard', dashboardParameterSettings: { "showIcon":true, // to show or hide the dashboard parameter icon "data":[{ "parameterName":"CustomerID", "showInParameterDialog":true, "showInPromptDialog":false, "value":"TRADH" }] }, } );
The below image illustrates the above code snippet: 2.openParameterDialog()This method is used to open the dashboard parameter dialog explicitly with the dashboard viewer instance. Example <script type="text/JavaScript"> var dashboardObject; $(document).ready(function () { dashboardObject = $('#dashboard').data("ejDashboardViewer"); dashboardObject.openParameterDialog(); }); </script>
The below image illustrates the above code snippets: 3.filterParametersThis API is used to pass the dashboard parameter by including them in the dashboard URL. Example: $("#dashboard").ejDashboardViewer({ serviceUrl: 'service URL', dashboardPath:'Path of the dashboard', filterParameters:location.search.substr(1) });
To set the dashboard parameter within the URL follow the syntax, @parameter = value Where parameter represents the parameter name. Here is the dashboard view illustrating the dashboard parameter in the URL. To append your query string made with the parameter name and value to URL, add a prefix(?) to the query string like below: http://<servername>//<culturename>/dashboards/<category>/<dashboardname>?@Parameter1=WILMK Here is the dashboard preview that illustrates the dashboard parameter through URL. Apply the dashboard parameter for the different users in the server:To apply the dashboard parameter 1) Open the dashboard in the Dashboard Designer. 2) Switch to the dashboard tab and click parameters… The dashboard parameters pop-up will appear and in the pop-up, click add. 1) In the dashboard parameters pop-up, select the List as mode. 2) Select the type based on the values that you want to add. 3) Enter the values that you want to add and click add. 4) Click save. Now, navigate to the server tab and click user filter… 1) User filters pop-up will appear and click add. 2) Choose data column pop-up will appear. You can select the parameters.
3) Enable the parameter that you want to select and click choose. 4) In the user filters pop-up, select the user and check the value that you want to add as parameter for the user and click ok.
5) Preview the designed dashboard as the user “Prince Solomon”. 6) Click the parameters icon, the prompt will appear. 7) In the drop-down, the value selected in the dashboard parameter for this user will be listed. Based on this you can filter the dashboard.
While previewing the dashboard as the user “Pavithra”, the drop-down in the prompt shows the value selected in the dashboard parameter for this user only. Based on this you can filter the dashboard. To show the prompt dialog while previewing, please check the option “Show Prompt” in the dashboard parameters pop-up.
While previewing the dashboard, the prompt will appear where you can select the parameter value based on which the dashboard will be filtered.
|
This page will automatically be redirected to the sign-in page in 10 seconds.