We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How to hide the Parameter's Prompt dialog during the Dashboard Viewer render

Platform: Dashboard Platform |
Control: Dashboard SDK |
Published Date: August 30, 2018 |
Last Revised Date: May 7, 2019

Hiding Dashboard Parameter prompt dialog

Dashboard Parameter dialog can be hidden (even though the Show Prompt is enabled in the Dashboard Designer during design) during the initial load by using the beforeLayoutRender event.

Find the following code snippet.

Angular

dashboard.component.html

<div>  <ej-dashboardviewer  id="dashboard" [serviceUrl]="url"   [dashboardPath]="dashboardPath" (beforeLayoutRender)="beforeLayoutRender($event)"> 
</ej-dashboardviewer> 
</div>

 

dashboard.component.ts

export class DashboardComponent { 
  public url; report;dashboardPath;parameter;param; 
  constructor() { 
    this.url = "http://dashboardsdkdemo.syncfusion.com/DashboardService/DashboardService.svc"; //Service URL 
    this.dashboardPath = "http://dashboardsdkdemo.syncfusion.com//Dashboards/Northwind Product Sales Analysis with parameter Dialog.sydx"; //path of the Dashboard 
    } 
   beforeLayoutRender(args){ 
      let i:any; 
      if (args.dashboardParameters !== null && args.dashboardParameters !== undefined && args.dashboardParameters.data!== null  && args.dashboardParameters.data!== undefined ){ 
     for( i=0;i<args.dashboardParameters.data.length;i++){ 
      if(args.dashboardParameters.data[i].showInPromptDialog){ 
          args.dashboardParameters.data[i].showInPromptDialog = false 
      } 
  } 
} 
} 
}

 

JavaScript

<script type="text/javascript">
    $(function (e) {
        $("#dashboard").ejDashboardViewer({
            serviceUrl: "",
            dashboardPath:"",
            beforeLayoutRender:function(args) {
                if (args.dashboardParameters !== null && args.dashboardParameters !== undefined && args.dashboardParameters.data !== null && args.dashboardParameters.data !== undefined) {
                    for (var i = 0; i < args.dashboardParameters.data.length; i++) {
                        if (args.dashboardParameters.data[i].showInPromptDialog) {
                            args.dashboardParameters.data[i].showInPromptDialog = false
                        }
                    }
                }
            }
        });
    });
</script>

 

ASP .NET MVC

<div>
@(Html.EJDashboard().DashboardViewer("dashboard").
    ServiceUrl("").
    DashboardPath("").
    FilterParameters("location.search.substring(1)").
    ClientSideEvents(evt => evt.BeforeLayoutRender("before")))
</div>
 
<script>
 
function beforeLayoutRender(args) {
if (args.dashboardParameters !== null && args.dashboardParameters !== undefined && args.dashboardParameters.data !== null && args.dashboardParameters.data !== undefined) {
 for (var i = 0; i < args.dashboardParameters.data.length; i++) {
 if (args.dashboardParameters.data[i].showInPromptDialog) {
       args.dashboardParameters.data[i].showInPromptDialog = false
       }
    }
   }
}
 
</script>

 

ADD COMMENT
You must log in to leave a comment

Please sign in to access our KB

This page will automatically be redirected to the sign-in page in 10 seconds.

Up arrow icon

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon