Skip to main content

DashboardToolboxItem Class

A toolbox item of a specified dashboard toolbox group.

Declaration

export class DashboardToolboxItem

Remarks

Create a new DashboardToolboxItem class instance and pass it with a group name to the ToolboxExtension.addToolboxItem property to add a new item to the specified Toolbox‘ group:

var toolboxItem = new DevExpress.Dashboard.Designer.DashboardToolboxItem('toolboxGroup', function () { /* ... */ }, "toolbox-icon");
dashboardControl.findExtension('toolbox').addToolboxItem("common", toolboxItem);

To obtain a list of dashboard toolbox items in a specified group, get access to the ToolboxExtension extension and use the items property.

var toolboxItems = dashboardControl.findExtension('toolbox').toolboxGroups()[0].items();

constructor(name, click, icon)

Initializes a new instance of the DashboardToolboxItem class.

Declaration

constructor(
    name: string,
    click: (itemTypeName: string) => void,
    icon: string,
    title?: string,
    type?: string
)

Parameters

Name Type Description
name string

A toolbox item’s unique name.

click (itemTypeName: string) => void

A function that is executed when a click occurs.

icon string

An icon in the SVG format that is displayed in the Toolbox.

title string

A toolbox item’s title.

type string

A itemTypesMap value of the dashboard item that will be created.

Properties

click Property

Specifies a custom function that is invoked on a click.

Declaration

click: (itemTypeName: string) => void

Property Value

Type Description
(itemTypeName: string) => void

A function that is executed when a click occurs.

disabled Property

Specifies whether a toolbox item should be disabled.

Declaration

disabled: ko.Subscribable<boolean>

Property Value

Type Description
Subscribable<boolean>

true, if a toolbox item should be disabled; otherwise, false.

icon Property

Specifies an icon of the dashboard toolbox item.

Declaration

icon: string

Property Value

Type Description
string

A string value that is the icon id from the SVG definition.

Remarks

Web Dashboard supports icons in the SVG format. To provide an icon for the toolbox element, add the SVG definition onto the page and assign the id value from the definition to the icon property.

See Predefined Colors for information on which color constants you can use to natively embed an icon in the Web Dashboard application.

The recommended icon size is 24 x 24 px.

name Property

Specifies the unique name of the dashboard toolbox item.

Declaration

name: string

Property Value

Type Description
string

A string value that is a toolbox item’s unique name.

Remarks

Use the name property value to address the toolbox item.

title Property

Specifies a dashboard toolbox item title.

Declaration

title: string

Property Value

Type Description
string

A string value that is a dashboard toolbox item title.

type Property

Specifies a dashboard item type.

Declaration

type: string

Property Value

Type Description
string

A itemTypesMap value of the dashboard item that will be created.

Remarks

A string value that is a dashboard item type from the itemTypesMap‘s list.