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 |
---|---|
Primitive |
A Primitive |
Primitive |
An array of the Primitive |
#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.
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();
}
});
}
#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 |
---|---|
Dashboard |
An array of Dashboard |
#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 |
---|---|
Primitive |
A Primitive |
Primitive |
An array of the Primitive |
#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 | Primitive |
A Primitive |
#Returns
Type | Description |
---|---|
any | The current parameter value |
#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.
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();
}
});
}