Shortcut Technical Reference
Summary
- Shortcuts are defined in Shortcut State
- Programmatic access to Shortcuts is through Shortcut API
Shortcut State
The Shortcut section of Initial Adaptable State contains a single collection of Shortcut objects:
| Property | Type | Description |
|---|---|---|
| Shortcuts | Shortcut[] | Collection of Shortcuts - designed to speed up data entry |
Shortcut Object
The Shortcut object contains 4 mandatory properties:
| Property | Type | Description |
|---|---|---|
| Name | string | Name of the Shortcut |
| Scope | ColumnScope<NumberScopeDataType> | Numeric Columns where Shortcut is applied |
| ShortcutKey | string | Key which triggers the Shortcut when pressed |
| ShortcutOperation | 'Add' | 'Subtract' | 'Multiply' | 'Divide' | The Operation: 'Add', 'Subtract', 'Multiply', 'Divide' |
| ShortcutValue | number | Value acting as 2nd operand for ShortcutOperation (1st operand is the cell value) |
| IsReadOnly | boolean | Sets Entity to ReadOnly (overwriting a Strategy Entitlement of 'Full') |
| IsSuspended | boolean | Suspends (i.e. turns off) an Adaptable Object |
Shortcut API
The Shortcut API section of Adaptable API contains many Shortcut-related methods including enabling fetching, creating, editing, deleting and suspending Shortcuts.
| Method | Returns | Description |
|---|---|---|
| addShortcut(shortcut) | Shortcut | Adds new Shortcut to the state |
| deleteShortcut(shortcut) | void | Deletes Shortcut from the state |
| editShortcut(shortcut) | Shortcut | Edits Shortcut in state |
| getActiveShortcuts(config) | Shortcut[] | Gets all active (not-suspended) Shortcuts in Adaptable State |
| getShortcutById(id, config) | Shortcut | Retrieves Shortcut by Id |
| getShortcutByName(name) | Shortcut | undefined | Retrieves a Shortcut by its Name |
| getShortcuts(config) | Shortcut[] | Gets all Shortcuts in Adaptable State |
| getShortcutState() | ShortcutState | Retrieves Shortcut section from Adaptable State |
| getSuspendedShortcuts(config) | Shortcut[] | Gets all suspended Shortcuts in Adaptable State |
| openShortcutSettingsPanel() | void | Opens Settings Panel with Shortcut section selected and visible |
| suspendAllShortcut() | void | Suspends all Shortcuts |
| suspendShortcut(shortcut) | Shortcut | Suspends Shortcut definition |
| unSuspendAllShortcut() | void | Activates all suspended Shortcut |
| unSuspendShortcut(shortcut) | Shortcut | Activates a suspended Shortcut definition |