DashboardMenuItem.hotKey Property
Gets or sets a code of the key used in the keyboard shortcut. This shortcut allows you to invoke the current menu item.
Namespace: DevExpress.Dashboard
Assembly: DevExpress.Dashboard.v17.2.Web.Scripts.dll
Declaration
Property Value
| Type | Description |
|---|---|
| Int32 | An integer value that specifies a key code. |
Remarks
You can use keyboard shortcuts to execute the dashboard menu commands. In the Web Dashboard, the ALT key is used as a modifier key to create a shortcut. To create a shortcut, assign the code of the required key to the hotKey property.
Note
For example, you can use the keyCode property to determine the key code.
The table below shows the Web Dashboard’s default shortcuts and related hotKey property values.
| Menu Item | Shortcut | Key code |
|---|---|---|
| New… | Alt+N | 78 |
| Open | Alt+O | 79 |
| Save… | Alt+S | 83 |
| Data Sources | Alt+A | 65 |
| Title | Alt+T | 84 |
| Currency | Alt+C | 67 |
| Parameters | Alt+P | 80 |
The following example demonstrates the code of a custom menu item which can be invoked using the Alt+I hotkey combination.
function onBeforeRender(sender, args) {
var dashboardControl = sender.GetDashboardControl();
var toolbox = dashboardControl .findExtension('toolbox');
var newMenuItem = {
title: "Custom Menu Item",
// ...
hotKey: 73
}
toolbox.addMenuItem(newMenuItem);
}