Skip to main content

DashboardParameter Interface

A dashboard parameter.

Declaration

export interface DashboardParameter

Methods

getDefaultValue Method

Returns a default parameter value.

Declaration

getDefaultValue(): DevExpress.Dashboard.Data.PrimitiveType | Array<DevExpress.Dashboard.Data.PrimitiveType>

Returns

Type Description
PrimitiveType

A PrimitiveType object that is a default parameter value.

PrimitiveType[]

An array of the PrimitiveType objects that are default parameter values.

Example

This example shows how to change dashboard parameter values on the client.

The example uses the following methods:

DashboardParameterDialogExtension.getParameters
Returns dashboard parameter settings and metadata.
DashboardParameter.setValue
Specifies the current parameter value(s).
DashboardParameter.getDefaultValue
Returns a default parameter value.
DashboardParameterDialogExtension.show
Invokes the Dashboard Parameters dialog.

View Example

function onBeforeRender(s) {
    var dashboardControl = s.GetDashboardControl();
    if (dashboardControl) {
        dashboardControl.on('dashboardEndUpdate', function () { setParameterValues(dashboardControl); })
    }
}

function setParameterValues(control) {
    var parameterDialogExt = control.findExtension('dashboardParameterDialog');
    $("#setParameterValuesButton").dxButton({
        text: 'Specify Parameter Values',
        onClick: function () {
            var parameters = parameterDialogExt.getParameters();
            var paramCategory = parameters.getParameterByName("categoryParameter"),
                paramStartDate = parameters.getParameterByName("startDateParameter");
            paramCategory.setValue("Condiments");
            paramStartDate.setValue(new Date(2015, 3, 1));
        }
    });
    $("#resetParameterValuesButton").dxButton({
        text: 'Reset Parameter Values',
        onClick: function () {
            var parameters = parameterDialogExt.getParameters();
            var paramCategory = parameters.getParameterByName("categoryParameter"),
                paramStartDate = parameters.getParameterByName("startDateParameter");
            paramCategory.setValue(paramCategory.getDefaultValue());
            paramStartDate.setValue(paramStartDate.getDefaultValue());
        }
    });
    $("#showParametersDialog").dxButton({
        text: 'Show Parameters Dialog',
        onClick: function () {
            parameterDialogExt.show();
        }
    });
}
See Also

getDescription Method

Returns the parameter’s description displayed to an end user.

Declaration

getDescription(): string

Returns

Type Description
string

A string that is the parameter’s description displayed to an end user.

getLookUpValues Method

Gets values for static and dynamic lists.

Declaration

getLookUpValues(): Array<DashboardParameterLookUpValue>

Returns

Type Description
DashboardParameterLookUpValue[]

An array of DashboardParameterLookUpValue objects that is a collection of default parameter values.

See Also

getName Method

Returns a parameter name.

Declaration

getName(): string

Returns

Type Description
string

A string that is the parameter name.

getType Method

Returns a parameter type.

Declaration

getType(): string

Returns

Type Description
string

A string that identifies the type of dashboard parameter value.

getValue Method

Returns the current parameter value(s).

Declaration

getValue(): DevExpress.Dashboard.Data.PrimitiveType | Array<DevExpress.Dashboard.Data.PrimitiveType>

Returns

Type Description
PrimitiveType

A PrimitiveType object that is the currently selected parameter value.

PrimitiveType[]

An array of the PrimitiveType objects that are currently selected parameter values.’

See Also

setValue(value) Method

Specifies the current parameter value(s).

Declaration

setValue(
    value: DevExpress.Dashboard.Data.PrimitiveType | Array<DevExpress.Dashboard.Data.PrimitiveType>
): any

Parameters

Name Type Description
value PrimitiveType | PrimitiveType[]

A PrimitiveType object that is the current parameter value(s).

Returns

Type Description
any

The current parameter value(s).

Example

This example shows how to change dashboard parameter values on the client.

The example uses the following methods:

DashboardParameterDialogExtension.getParameters
Returns dashboard parameter settings and metadata.
DashboardParameter.setValue
Specifies the current parameter value(s).
DashboardParameter.getDefaultValue
Returns a default parameter value.
DashboardParameterDialogExtension.show
Invokes the Dashboard Parameters dialog.

View Example

function onBeforeRender(s) {
    var dashboardControl = s.GetDashboardControl();
    if (dashboardControl) {
        dashboardControl.on('dashboardEndUpdate', function () { setParameterValues(dashboardControl); })
    }
}

function setParameterValues(control) {
    var parameterDialogExt = control.findExtension('dashboardParameterDialog');
    $("#setParameterValuesButton").dxButton({
        text: 'Specify Parameter Values',
        onClick: function () {
            var parameters = parameterDialogExt.getParameters();
            var paramCategory = parameters.getParameterByName("categoryParameter"),
                paramStartDate = parameters.getParameterByName("startDateParameter");
            paramCategory.setValue("Condiments");
            paramStartDate.setValue(new Date(2015, 3, 1));
        }
    });
    $("#resetParameterValuesButton").dxButton({
        text: 'Reset Parameter Values',
        onClick: function () {
            var parameters = parameterDialogExt.getParameters();
            var paramCategory = parameters.getParameterByName("categoryParameter"),
                paramStartDate = parameters.getParameterByName("startDateParameter");
            paramCategory.setValue(paramCategory.getDefaultValue());
            paramStartDate.setValue(paramStartDate.getDefaultValue());
        }
    });
    $("#showParametersDialog").dxButton({
        text: 'Show Parameters Dialog',
        onClick: function () {
            parameterDialogExt.show();
        }
    });
}
See Also