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:

PropertyTypeDescription
ShortcutsShortcut[]Collection of Shortcuts - designed to speed up data entry

Shortcut Object

The Shortcut object contains 4 mandatory properties:

PropertyTypeDescription
NamestringName of the Shortcut
ScopeColumnScope<NumberScopeDataType>Numeric Columns where Shortcut is applied
ShortcutKeystringKey which triggers the Shortcut when pressed
ShortcutOperation'Add' | 'Subtract' | 'Multiply' | 'Divide'The Operation: 'Add', 'Subtract', 'Multiply', 'Divide'
ShortcutValuenumberValue acting as 2nd operand for ShortcutOperation (1st operand is the cell value)
IsReadOnlybooleanSets Entity to ReadOnly (overwriting a Strategy Entitlement of 'Full')
IsSuspendedbooleanSuspends (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.

MethodReturnsDescription
addShortcut(shortcut)ShortcutAdds new Shortcut to the state
deleteShortcut(shortcut)voidDeletes Shortcut from the state
editShortcut(shortcut)ShortcutEdits Shortcut in state
getActiveShortcuts(config)Shortcut[]Gets all active (not-suspended) Shortcuts in Adaptable State
getShortcutById(id, config)ShortcutRetrieves Shortcut by Id
getShortcutByName(name)Shortcut | undefinedRetrieves a Shortcut by its Name
getShortcuts(config)Shortcut[]Gets all Shortcuts in Adaptable State
getShortcutState()ShortcutStateRetrieves Shortcut section from Adaptable State
getSuspendedShortcuts(config)Shortcut[]Gets all suspended Shortcuts in Adaptable State
openShortcutSettingsPanel()voidOpens Settings Panel with Shortcut section selected and visible
suspendAllShortcut()voidSuspends all Shortcuts
suspendShortcut(shortcut)ShortcutSuspends Shortcut definition
unSuspendAllShortcut()voidActivates all suspended Shortcut
unSuspendShortcut(shortcut)ShortcutActivates a suspended Shortcut definition