dashboard-js-devexpress-dot-dashboard-aaef89c0.md
A Web Dashboard extension that is the Dashboard Parameters dialog.
export class DashboardParameterDialogExtension extends DisposableObject implements ISupportOptionExtension<DashboardParameterDialogExtensionOptions>
To configure the extension, refer to the DashboardParameterDialogExtensionOptions class that contains the Dashboard Parameter Dialog’s options.
See the following topic for information on how to use the DashboardControl’s client-side API: Extensions Overview.
ISupportOptionExtension
DisposableObject DashboardParameterDialogExtension
Initializes a new instance of the DashboardParameterDialogExtension class.
constructor(
dashboardControl: DevExpress.Dashboard.DashboardControl,
options?: DashboardParameterDialogExtensionOptions
)
| Name | Type | Description |
|---|---|---|
| dashboardControl | DashboardControl |
A Web Dashboard control that owns the extension.
| | options | DashboardParameterDialogExtensionOptions |
A DashboardParameterDialogExtensionOptions object that contains the extension options.
|
Specifies the unique extension name.
name: string
| Type | Description |
|---|---|
| string |
The unique extension name. The return value is dashboardParameterDialog.
|
Use the dashboardParameterDialog name in the following cases:
Warning
Do not change the unique name of the extension registered in the Web Dashboard to avoid exceptions.
Unsubscribes from DashboardParameterDialogExtension events.
off: DevExpress.Dashboard.Internal.EventSubscriber<DashboardParameterDialogExtensionEvents>
| Type | Description |
|---|---|
| EventSubscriber<DashboardParameterDialogExtensionEvents> |
An event subscription.
|
The extension’s on and off methods help you subscribe to and unsubscribe from events.
Subscribes to DashboardParameterDialogExtension events.
on: DevExpress.Dashboard.Internal.EventSubscriber<DashboardParameterDialogExtensionEvents>
| Type | Description |
|---|---|
| EventSubscriber<DashboardParameterDialogExtensionEvents> |
An event subscription.
|
The extension’s on and off methods help you subscribe to and unsubscribe from events.
A handler for the event that occurs when the Dashboard Parameter dialog is hidden.
get onHidden(): ((e: DashboardParameterDialogArgs) => any)
set onHidden(value: ((e: DashboardParameterDialogArgs) => any))
| Type | Description |
|---|---|
| (e: DashboardParameterDialogArgs) => any |
A function that is executed when the Dashboard Parameter dialog is hidden.
|
A handler for the event that occurs before the Dashboard Parameter dialog is shown.
get onShowing(): ((e: DashboardParameterDialogArgs) => any)
set onShowing(value: ((e: DashboardParameterDialogArgs) => any))
| Type | Description |
|---|---|
| (e: DashboardParameterDialogArgs) => any |
A function that is executed before the Dashboard Parameter dialog is shown.
|
A handler for the event that occurs after the Dashboard Parameter dialog is shown.
get onShown(): ((e: DashboardParameterDialogArgs) => any)
set onShown(value: ((e: DashboardParameterDialogArgs) => any))
| Type | Description |
|---|---|
| (e: DashboardParameterDialogArgs) => any |
A function that is executed after the Dashboard Parameter dialog is shown.
|
Specifies whether the Parameter button is shown in the dashboard title.
showDialogButton: ko.Observable<boolean>
| Type | Description |
|---|---|
| Observable<boolean> |
true , to show the Parameter button in the dashboard title; otherwise, false.
|
You can change the values of the dashboard parameters in the Dashboard Parameters dialog. To open the dialog, click the Parameters button in the dashboard title.
You can hide the Parameters button. To do this, pass false to the showDialogButton property:
// The dashboardControl variable is the obtained DashboardControl instance.
var parameterDialogExt = dashboardControl.findExtension('dashboardParameterDialog');
parameterDialogExt.showDialogButton(false);
For more information on how to change the dashboard parameter values in the UI and in code, refer to the following article: Specify Dashboard Parameter Values.
See Also
Specify Dashboard Parameter Values
Returns dashboard parameter settings and metadata.
getParameters(): DevExpress.Dashboard.DashboardParameterCollection
| Type | Description |
|---|---|
| DashboardParameterCollection |
A DashboardParameterCollection object that contains parameter settings and metadata.
|
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
Closes the Dashboard Parameters dialog.
hide(): void
Renders the content of the Dashboard Parameter dialog inside the specified DOM element.
renderContent(
element: JQuery | Element
): DevExpress.Dashboard.ParameterDialogContent
| Name | Type | Description |
|---|---|---|
| element | Element | JQuery<HTMLElement> |
A DOM element where the content of the Dashboard Parameter dialog is rendered.
|
| Type | Description |
|---|---|
| ParameterDialogContent |
A content of the Dashboard Parameter dialog.
|
Invokes the Dashboard Parameters dialog.
show(): void
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
Contains code that is executed when you register the dashboard extension.
start(): void
Contains code that is executed when you unregister the dashboard extension.
stop(): void
Allows you to handle any changes in the collection of dashboard parameters.
subscribeToContentChanges(
callback: (newValue: DevExpress.Dashboard.DashboardParameterCollection) => void
): ko.Subscription
| Name | Type | Description |
|---|---|---|
| callback | (newValue: DashboardParameterCollection) => void |
A function that is called on any changes in the collection of dashboard parameters.
|
| Type | Description |
|---|---|
| ko.Subscription |
A KnockoutSubscription object that allows you to terminate a subscription.
|
The subscribeToContentChanges method is used in the custom Parameter item.
The method allows you to subscribe to any changes in the collection of dashboard parameters:
See Also