The requested page is not available for the requested platform. You are viewing the content for Default platform.

ComboBoxItem Class

A Combo Box dashboard item that allows end users to filter other dashboard items.

Declaration

export class ComboBoxItem extends FilterElementItemBase

Remarks

The Combo Box dashboard item allows end users to filter other dashboard items by selecting a value(s) from the drop-down list .

wdd-combo-box-standard-type

Refer to Filter Elements Overview to learn more about filter elements.

Examples

The following example shows how to create the Combo Box dashboard item, bind it to data and add to the existing dashboard.

Create data items (dimensions) and use the DataItem.dataMember property to bind them to the existing data source's columns. Then use the created dimensions in the dashboard item to bind it to data.

After you add the created dashboard item to the Dashboard.items collection, call the Dashboard.rebuildLayout method to rebuild the dashboard layout and display changes.

// Use the line below for a modular approach:
// import * as Model from 'devexpress-dashboard/model'
// Use the line below for an approach with global namespaces:
// var Model = DevExpress.Dashboard.Model;

// ...
public creatComboBox() { 
    // Create data items for the ComboBox.
    var comboBoxCountry = new Model.Dimension();
    comboBoxCountry.dataMember("Country");
    var comboBoxFullName = new Model.Dimension();
    comboBoxFullName.dataMember("FullName");

    // Create the ComboBox dashboard item and bind it to data.
    var comboBoxItem = new Model.ComboBoxItem();
    comboBoxItem.name('comboBox');
    comboBoxItem.dataSource(sqlDataSource.componentName());
    comboBoxItem.dataMember(sqlDataSource.queries()[0].name());

    comboBoxItem.filterDimensions.push(comboBoxCountry);
    comboBoxItem.filterDimensions.push(comboBoxFullName);

    comboBoxItem.comboBoxType("Checked");

    control.dashboard().items.push(comboBoxItem);
    // ...
    control.dashboard().rebuildLayout();
}
See Also

constructor

Initializes a new instance of the ComboBoxItem class.

Declaration

constructor(dashboardItemJSON?: any, serializer?: DxDesigner.Analytics.Utils.ModelSerializer)

Optional Parameters

Name Type Default Description
dashboardItemJSON any null

A JSON object used for a dashboard deserialization. Do not pass this parameter directly.

serializer DxDesigner.Analytics.Utils.ModelSerializer null

An object used for a dashboard deserialization. Do not pass this parameter directly.

Properties

comboBoxType Property

Specifies the type of the Combo Box dashboard item.

Declaration

comboBoxType: ko.Observable<ComboBoxDashboardItemType>

Property Value

Type Description
ko.Observable<ComboBoxDashboardItemType>

A ComboBoxDashboardItemType value that specifies the type of the Combo Box dashboard item.

showAllValue Property

Declaration

showAllValue: ko.Observable<boolean>

Property Value

Type Description
ko.Observable<boolean>

Methods

getInfo Method

For internal use.

Declaration

getInfo(): DxDesigner.Analytics.Utils.ISerializationInfoArray

Returns

Type Description
DxDesigner.Analytics.Utils.ISerializationInfoArray