Skip to main content
A newer version of this page is available. .

DashboardState Class

A data container for changes resulting from end-user interaction - selected master filter values, drill-down levels, selected dashboard item layers and current parameter values.

Declaration

export class DashboardState

Remarks

The DashboardState class includes states of individual dashboard items (the DashboardState.Items property) and currently selected parameter values (DashboardState.Parameters).

The following example shows how to apply the dashboard state to the Energy Statistics demo. The Year parameter is 2008, the Card‘s master filter value is Solid Fuels.

public btnClick() {
  var state: DashboardState = { 
    Parameters:{ 
      "Year": 2008 
    }, 
    Items: {
      "cardProductionImportByType": {
        MasterFilterValues: [["Solid Fuels"]]
      }
    } 
  }
  this.dashboardControl.setDashboardState(state);
}

The code below shows how to apply the dashboard state to the Sales Overview demo. The Range Filter‘s predefined period is 6 Month, the Grid‘s master filter value is Nevada.

public btnClick() {
  var state: DashboardState = { 
    // ... 
    Items: {
      "gridSalesByState": {
        MasterFilterValues: [["Nevada"]]
      },
      "range": {
        RangeFilterState: {
          PeriodName: "6 Months"
        }
      }
    } 
  }
  this.dashboardControl.setDashboardState(state);
}

Properties

Items Property

Provides access to states of individual dashboard items displayed in the dashboard.

Declaration

Items: {
    [id: string]: ItemState;
}

Property Value

Type Description
[id: string]: ItemState

A collection of ItemState objects that are states of individual dashboard items.

Remarks

The Items property provide access to the following states:

State Value

API

selected master filters values

ItemState.MasterFilterValues

current drill-down levels

ItemState.DrillDownValues

a selected tab page

ItemState.TabPageName

Range Filter settings

ItemState.RangeFilterState

a selected dashboard item layer1

ItemState.SelectedLayerIndex

1 For the Pie, Card, Treemap, Gauge and Choropleth Map dashboard items.

Parameters Property

Provides access to states of dashboard parameters.

Declaration

Parameters: {
    [id: string]: any;
}

Property Value

Type Description
[id: string]: any

A collection of dashboard parameter states.

Remarks

The following example shows how to apply the dashboard state to the Energy Statistics demo. The Year parameter is 2008.

public btnClick() {
  var state: DashboardState = { 
    Parameters:{ 
      "Year": 2008 
    }
    // ...
  }
  this.dashboardControl.setDashboardState(state);
}