dashboard-js-devexpress-dot-dashboard-6e958432.md
A dashboard parameter.
export interface DashboardParameter
Returns a default parameter value.
getDefaultValue(): DevExpress.Dashboard.Data.PrimitiveType | Array<DevExpress.Dashboard.Data.PrimitiveType>
| Type | Description |
|---|---|
| PrimitiveType |
A PrimitiveType object that is a default parameter value.
| | PrimitiveType[] |
An array of the PrimitiveType objects that are default parameter values.
|
This example shows how to change dashboard parameter values on the client.
The example uses the following methods:
DashboardParameterDialogExtension.getParametersReturns dashboard parameter settings and metadata.DashboardParameter.setValueSpecifies the current parameter value(s).DashboardParameter.getDefaultValueReturns a default parameter value.DashboardParameterDialogExtension.showInvokes 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();
}
});
}
See Also
Specify Dashboard Parameter Values
Returns the parameter’s description displayed to an end user.
getDescription(): string
| Type | Description |
|---|---|
| string |
A string that is the parameter’s description displayed to an end user.
|
Gets values for static and dynamic lists.
getLookUpValues(): Array<DashboardParameterLookUpValue>
| Type | Description |
|---|---|
| DashboardParameterLookUpValue[] |
An array of DashboardParameterLookUpValue objects that is a collection of default parameter values.
|
See Also
Create a Dashboard Parameter in the WinForms Designer
Returns a parameter name.
getName(): string
| Type | Description |
|---|---|
| string |
A string that is the parameter name.
|
Returns a parameter type.
getType(): string
| Type | Description |
|---|---|
| string |
A string that identifies the type of dashboard parameter value.
|
Returns the current parameter value(s).
getValue(): DevExpress.Dashboard.Data.PrimitiveType | Array<DevExpress.Dashboard.Data.PrimitiveType>
| 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
Specify Dashboard Parameter Values
Specifies the current parameter value(s).
setValue(
value: DevExpress.Dashboard.Data.PrimitiveType | Array<DevExpress.Dashboard.Data.PrimitiveType>
): any
| Name | Type | Description |
|---|---|---|
| value | PrimitiveType | PrimitiveType[] |
A PrimitiveType object that is the current parameter value(s).
|
| Type | Description |
|---|---|
| any |
The current parameter value(s).
|
This example shows how to change dashboard parameter values on the client.
The example uses the following methods:
DashboardParameterDialogExtension.getParametersReturns dashboard parameter settings and metadata.DashboardParameter.setValueSpecifies the current parameter value(s).DashboardParameter.getDefaultValueReturns a default parameter value.DashboardParameterDialogExtension.showInvokes 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();
}
});
}
See Also