Back to Devexpress

ListBoxItem Class

dashboard-js-devexpress-dot-dashboard-dot-model-4cb2a752.md

latest8.0 KB
Original Source

ListBoxItem Class

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

Declaration

ts
export class ListBoxItem extends FilterElementItemBase

Remarks

The List Box dashboard allows end users to filter other dashboard items by selecting a value(s) from the list.

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

Example

The following example shows how to create the List 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.

javascript
// 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 creatListBox() { 
    // Create data items for the ListBox.
    var listBoxCountry = new Model.Dimension();
    listBoxCountry.dataMember("Country");
    var listBoxFullName = new Model.Dimension();
    listBoxFullName.dataMember("FullName");

    // Create the ListBox dashboard item and bind it to data.
    var listBoxItem = new Model.ListBoxItem();
    listBoxItem.name('listBox');
    listBoxItem.dataSource(sqlDataSource.componentName());
    listBoxItem.dataMember(sqlDataSource.queries()[0].name());

    listBoxItem.filterDimensions.push(listBoxCountry);
    listBoxItem.filterDimensions.push(listBoxFullName);

    listBoxItem.listBoxType('Radio');

    control.dashboard().items.push(listBoxItem);
    // ...
    control.dashboard().rebuildLayout();
}

Inherited Members

colorScheme

coloringOptions

componentName

customProperties

dataItems

dataMember

dataSource

disposed

enableSearch

filterDimensions

filterString

formatRules

hiddenDimensions

hiddenMeasures

interactivityOptions

isDisposed

isMasterFilterCrossDataSource

itemType

name

parentContainer

showCaption

visibleDataFilterString

dispose

getInfo

getUniqueNamePrefix

Inheritance

SerializableModel TypedSerializableModel DashboardItem DataDashboardItem FilterElementItemBase ListBoxItem

See Also

Filter Elements Overview (Web)

constructor

Initializes a new instance of the ListBoxItem class.

Declaration

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

Parameters

NameTypeDescription
dashboardItemJSONany

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

| | serializer | ModelSerializer |

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

|

Properties

listBoxType Property

Specifies the type of the List Box dashboard item.

Declaration

ts
listBoxType: ko.Observable<DevExpress.Dashboard.Model.ListBoxDashboardItemType>

Property Value

TypeDescription
Observable<ListBoxDashboardItemType>

A ListBoxDashboardItemType enumeration value that specifies the type of the List Box dashboard item.

|

showAllValue Property

Declaration

ts
showAllValue: ko.Observable<boolean>

Property Value

Type
Observable<boolean>