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.
Unfortunately, activation email could not send to your email. Please try again.

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

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>

 

Article ID: Published Date: Last Revised Date: Platform: Control:
9225 08/30/2018 08/30/2018 Dashboard Platform Dashboard Viewer
Did you find this information helpful?
Add Comment
You must log in to leave a comment

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.