416.467.9100 | Dundas Data Visualization | Login
Welcome Guest
This is the support page for the legacy Dundas Dashboard application. For assistance with the current Dundas BI application please click here.
Dashboard v5.5

This site makes extensive use of JavaScript.

Please enable JavaScript in your web browser and reload the page before proceeding.

Using the Disable Loading Data property

Hide navigation
RSS
Modified on Wed, 02 Dec 2015 02:54 PM

Disable Loading Data is a property that exists on all data-driven controls and on the dashboard except for analytical dashboards. When set to true, it causes any data-driven controls to stop loading the data they are linked to. Using this property allows you to avoid loading data when it's not needed which helps with performance. Setting this property to false causes the control or dashboard to retrieve its data again.

Tip: Controls with Disable Loading Data set to true and false can be linked to the same parameter. The ones set to false will continue to retrieve new data when the parameter changes.

Tip: Setting Disable Loading Data to false at any point in a script will cause the control/dashboard to retrieve data, even if the same script later sets it to true.

Overview

There are two main applications for using Disable Loading Data:

  • When the default parameter values need to be determined dynamically.
  • When your dashboard contains hidden controls that aren't expected to show most of the time.

Dynamically setting initial parameter values

When a dashboard is opened, the following sequence of events occurs:

  1. The dashboard definition (what controls exist, scripts, etc.) is loaded.
  2. All dashboard controls are created.
  3. Default parameter values are applied.
  4. All dashboard controls retrieve their data.
  5. Once all controls have finished loading data, the dashboard's Load Interaction fires.

When a control or dashboard has Disable Loading Data set to true, it will not request data on load (step #4) or even if a parameter linked to it changes values.

When initial parameter values need to be determined dynamically, loading data with the default parameters is wasteful since they'll be changed immediately in the Load Interaction. Therefore set Disable Loading Data to true in the dashboard designer so the control doesn't load any data initially. The script in the Load Interaction can invalidate any parameters, then set the property to false.

Tip: When a control doesn't load data initially, you will need to move scripts you would normally put in the Load Interaction to the control's On Data Changed Interaction or On Layout Updated Interaction if the script depends on data.



Example

Here is a brief example of how to use this feature to set the initial parameters for a data grid dynamically, using data contained in a second grid. The Load script will read the data from the second grid and select a date range for the last 4 months up to the end date. Here is the data:

Sample data to display

Sample data to display


Table which contains the end date to select

Table which contains the end date to select


  1. Create a dataset for both tables. In the sample data table, make the filter on the Date column public:
    Date filter in the sample data

    Date filter in the sample data

  2. Add the end date dataset to a grid called LastUpdateGrid.
  3. Add the sample data dataset to a grid called DataGrid1.
  4. Expand the Advanced Properties on DataGrid1 and set Disable Loading Data to true.
    Disabling loading data for the sample data dataset.

    Disabling loading data for the sample data dataset.

  5. Create a parameter called DateParameter and link it to the Date column filter on the sample data dataset.
  6. Add this script to the Load interaction:

  1. UNSUPPORTED UNLIMITED

// Get the last update time from the second grid. // Calculate the start date by subtracting 3 months. DashboardDataDescriptor lastUpdateDescriptor = LastUpdateGrid.DataDescriptors0; DateTime lastDate = (DateTime)lastUpdateDescriptor.GetDataPointColumnValue(lastUpdateDescriptor.DataResult.DataPoints0, "Last Update"); DateTime firstDate = lastDate.AddMonths(-3);

// Build the new parameter settings to select this range of dates. ParameterInfo dateParameterInfo = new ParameterInfo(); dateParameterInfo.ParameterName = "DateParameter";

DashboardFilterValueData filter = new DashboardFilterValueData(); filter.IsConsolidatedDateTime = true; filter.IsRange = true;

DashboardMemberValueData rangeStart = new DashboardMemberValueData(); rangeStart.DateTimeGrain = DateTimeGrain.Day; rangeStart.Operator = ComparisonOperator.GreaterOrEqualThan; rangeStart.ReadableValues.Add(firstDate.ToString()); rangeStart.Values.Add(firstDate);

DashboardMemberValueData rangeEnd = new DashboardMemberValueData(); rangeEnd.DateTimeGrain = DateTimeGrain.Day; rangeEnd.Operator = ComparisonOperator.SmallerThan; rangeEnd.ReadableValues.Add(lastDate.AddDays(1).AddSeconds(-1).ToString()); rangeEnd.Values.Add(lastDate.AddDays(1).AddSeconds(-1));

filter.MemberValues.Add(rangeStart); filter.MemberValues.Add(rangeEnd); dateParameterInfo.FilterValues.Add(filter);

// Update the parameter and commit the selection. DateParameter.UpdateFromParameterInfo(dateParameterInfo); DateParameter.InvalidateFilter();

// Allow the main grid to load its data. DataGrid1.IsLoadingDataDisabled = false;




Related Topics

About Dundas | Contact Us Follow us on Twitter! | Privacy Statement | Report Site Issues

Copyright © 2009-2016 Dundas Data Visualization, Inc.