xtrareports-js-devexpress-dot-analytics-dot-utils.md
Provides information about a command available in the toolbar or menu.
export interface IAction
See Customize the Report Designer Toolbar and Customize the Document Viewer Toolbar for more information.
Provides access to the action performed when a button is clicked.
clickAction?: (model?: any) => void
| Type | Description |
|---|---|
| (model?: any) => void |
The action performed when a button is clicked.
|
Provides access to a value that specifies the command location.
container?: string
| Type | Description |
|---|---|
| string |
A string that specifies the command location.
|
If the command is displayed on the designer menu, then this property returns “ menu “. If the command is displayed on the toolbar, the “ toolbar “ value is returned.
contentData?: any
| Type |
|---|
| any |
Provides access to the value that specifies whether or not the command is disabled by default.
disabled?: Observable<boolean> | Computed<boolean> | boolean
| Type |
|---|
| any |
getViewModel?: (parent: DevExpress.Analytics.Internal.ActionListsBase, index: number) => IActionViewModel
| Type |
|---|
| (parent: ActionListsBase, index: number) => IActionViewModel |
group?: () => string
| Type |
|---|
| () => string |
Specifies whether the command has a visual separator.
hasSeparator?: boolean
| Type | Description |
|---|---|
| boolean |
true , if the command has a visual separator; otherwise, false.
|
Provides access to the keyboard shortcut used to invoke the command.
hotKey?: IHotKey | IHotKey[]
| Type | Description |
|---|---|
| IHotKey |
The keyboard shortcut.
| | IHotKey[] | |
Handle the CustomizeMenuActions client-side event to get the Action object. Use the hotKey property to specify a key that the user presses to run the action.
The following event handler function disables the hotkey ( F ) for the Search command. When the user presses the F key, the Search panel does not appear:
function customizeMenuActions(s, e) {
var searchAction = e.GetById(DevExpress.Reporting.Viewer.ActionId.Search);
if (searchAction)
searchAction.hotKey = null;
}
<dx-report-viewer [reportUrl]="reportUrl">
<dxrv-callbacks (CustomizeMenuActions)="CustomizeMenuActions($event)"></dxrv-callbacks>
</dx-report-viewer>
import { ActionId } from "devexpress-reporting/viewer/constants"
...
CustomizeMenuActions(e) {
var searchAction = e.args.GetById(ActionId.Search);
if (searchAction)
searchAction.hotKey = null;
}
Note
To use ActionId constants in typescript code, add the following directive:
import { ActionId } from "devexpress-reporting/viewer/constants";
Provides access to the CSS class of the command’s icon.
imageClassName?: Observable<string> | Computed<string> | string
| Type | Description |
|---|---|
| any |
The name of the CSS class.
|
Provides access to the HTML template of the command’s icon.
imageTemplateName?: Observable<string> | Computed<string> | string
| Type | Description |
|---|---|
| any |
The name of the HTML template.
|
isContextMenuAction?: boolean
| Type |
|---|
| boolean |
Provides access to the value that specifies whether the command is selected.
selected?: Observable<boolean> | Computed<boolean> | boolean
| Type |
|---|
| any |
Provides access to the text for the command.
text?: string
| Type | Description |
|---|---|
| string |
A string that is the command text.
|
Provides access to the value that specifies whether the command is visible in the user interface.
visible?: Observable<boolean> | Computed<boolean> | boolean
| Type | Description |
|---|---|
| any |
true if the command is visible; otherwise false.
|