Back to Devexpress

IAction Interface

xtrareports-js-devexpress-dot-analytics-dot-utils.md

latest5.7 KB
Original Source

IAction Interface

Provides information about a command available in the toolbar or menu.

Declaration

ts
export interface IAction

Remarks

See Customize the Report Designer Toolbar and Customize the Document Viewer Toolbar for more information.

Properties

clickAction Property

Provides access to the action performed when a button is clicked.

Declaration

ts
clickAction?: (model?: any) => void

Property Value

TypeDescription
(model?: any) => void

The action performed when a button is clicked.

|

container Property

Provides access to a value that specifies the command location.

Declaration

ts
container?: string

Property Value

TypeDescription
string

A string that specifies the command location.

|

Remarks

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 Property

Declaration

ts
contentData?: any

Property Value

Type
any

disabled Property

Provides access to the value that specifies whether or not the command is disabled by default.

Declaration

ts
disabled?: Observable<boolean> | Computed<boolean> | boolean

Property Value

Type
any

getViewModel Property

Declaration

ts
getViewModel?: (parent: DevExpress.Analytics.Internal.ActionListsBase, index: number) => IActionViewModel

Property Value

Type
(parent: ActionListsBase, index: number) => IActionViewModel

group Property

Declaration

ts
group?: () => string

Property Value

Type
() => string

hasSeparator Property

Specifies whether the command has a visual separator.

Declaration

ts
hasSeparator?: boolean

Property Value

TypeDescription
boolean

true , if the command has a visual separator; otherwise, false.

|

hotKey Property

Provides access to the keyboard shortcut used to invoke the command.

Declaration

ts
hotKey?: IHotKey | IHotKey[]

Property Value

TypeDescription
IHotKey

The keyboard shortcut.

| | IHotKey[] | |

Remarks

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.

Example

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:

JavaScript

javascript
function customizeMenuActions(s, e) {
    var searchAction = e.GetById(DevExpress.Reporting.Viewer.ActionId.Search); 
    if (searchAction)
    searchAction.hotKey = null;
}

Angular

html
<dx-report-viewer [reportUrl]="reportUrl">
    <dxrv-callbacks (CustomizeMenuActions)="CustomizeMenuActions($event)"></dxrv-callbacks>
</dx-report-viewer>
ts
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";

imageClassName Property

Provides access to the CSS class of the command’s icon.

Declaration

ts
imageClassName?: Observable<string> | Computed<string> | string

Property Value

TypeDescription
any

The name of the CSS class.

|

imageTemplateName Property

Provides access to the HTML template of the command’s icon.

Declaration

ts
imageTemplateName?: Observable<string> | Computed<string> | string

Property Value

TypeDescription
any

The name of the HTML template.

|

isContextMenuAction Property

Declaration

ts
isContextMenuAction?: boolean

Property Value

Type
boolean

selected Property

Provides access to the value that specifies whether the command is selected.

Declaration

ts
selected?: Observable<boolean> | Computed<boolean> | boolean

Property Value

Type
any

text Property

Provides access to the text for the command.

Declaration

ts
text?: string

Property Value

TypeDescription
string

A string that is the command text.

|

visible Property

Provides access to the value that specifies whether the command is visible in the user interface.

Declaration

ts
visible?: Observable<boolean> | Computed<boolean> | boolean

Property Value

TypeDescription
any

true if the command is visible; otherwise false.

|