Alerts Technical Reference

Summary

  • Alerts are configured i the Alert section of Adaptable State
  • Alert Options contains many properties to enable fine-tuned configuring of Alerts
  • Run-time access to Alerts is primarily available through Alert API
  • The Alert Fired event is published every time an Alert is fired in AdapTable

Alert State

The Alert section of Adaptable State contains a collection of AlertDefinition objects:

PropertyDescription
AlertDefinitionsAlert Definitions - will trigger Alerts when rule is met

Alert Definition

Each Alert Definition is defined as follows:

PropertyDescription
AlertFormForm to display in Alert with buttons and inputs
AlertPropertiesSeries of properties which set what happens when Alert is triggered
MessageHeaderTitle of displayed Alert Message
MessageTextTitle of displayed Alert Message; if null, AdapTable creates dynamically using Rule & Scope
MessageTypeType of Alert: 'Info', 'Success', 'Warning', 'Error'; influences Alert colour, icon and logging
NameName of the Alert Definition
RuleWhen Alert should be triggered
ScopeWhere Alert can be triggered: one, some or all columns or DataTypes
IsReadOnlySets Entity to ReadOnly (overwriting a Strategy Entitlement of 'Full')
IsSuspendedSuspends (i.e. turns off) an Adaptable Object

Alert Properties

The Alert Properties object defines some optional behaviour for the Alert:

PropertyDescriptionDefault
DisplayNotificationDisplays a notification when Alert is triggered
HighlightCellColours updated Row using MessageType of triggering Alert Definition
HighlightRowColours updated Row using MessageType of triggering Alert Definition
JumpToCellGrid will 'jump' to the changed cell which triggered the Alert
JumpToRowGrid will 'jump' to the newly added row which triggered the Alert
LogToConsoleLogs the Alert message to the console
NotificationDurationNotifiction duration(defaults to NotificationOptions.duration)
PreventEditAutomatically prevent any cell edit which triggered the Alert (i.e. validation)false
ShowInDivShows Alert text in the div specificed in alertContainer property of Container Options

Alert Options

PropertyDescriptionDefault
alertFormsFull definitions of Alert Forms - the names of which are provided in Alert State
alertMessageHeaderFunction providing Header to display in Alert; if empty, AdapTable provides dynamically
alertMessageTextFunction providing Message to display in Alert; if empty, AdapTable provides dynamically
cellHighlightDurationHow long (in ms) a Cell will be highlighted when an Alert fires2000
commandHandlersCustom onClick Handlers for Buttons (displayed in Alert Forms)
dataChangeDetectionPolicyWhether Alert rule is evaluated against the rawValue or formattedValue of the changed cell data'rawValue'
maxAlertsInStoreHow many alerts held in State at any one time; when limit is breached, oldest alert will be removed20
rowHighlightDurationHow long (in ms) a Row will be highlighted when an Alert Fires4000
showMissingPrimaryKeyAlertShows Alert if Primary Key column in Adaptable Options is not present or incorrectfalse
statusbarHighlightDurationHow long (in ms) Alert panel in Status Bar highlights when an Alert Fires2000

Alert API

Full programmatic access to Alerts and related features is available in Alert API.

This enables Alerts to be accessed, created, edited, deleted and shared programmatically.

MethodDescription
addAlertDefinition(alertDefinition)Adds given Alert Definition to Adaptable State
deleteAlertDefinition(alertDefinition)Deletes given Alert Definition from Adaptable State
displayAdaptableAlert(alertToShow)Displays the given Adaptable Alert
displayAdaptableAlertNotification(alert)Displays given Alert as a Toast
editAlertDefinition(alertDefinition)Updates given Alert Definition in Adaptable State
evaluateAlertDefinitions(alertDefinitions)Evaluates the given Alert Definitions - will fire Alert if rule is met
findAlertDefinitions(alertLookupCriteria)Find all Alert Definitions which match the given criteria
getActiveAlertDefinitions(config)Retrieves all Alert Definitions which are currently active
getAlertDefinitionById(id, config)Retrieves alert definition by the technical ID (from AlertState)
getAlertDefinitionByName(name)Retrieves an Alert Definition by its Name
getAlertDefinitions(config)Retrieves all Alert Definitions in Alert State
getAlertState()Retrieves Alert section from Adaptable State
getSuspendedAlertDefinitions(config)Retrieves all Alert Definitions which are currently suspended
openAlertSettingsPanel()Opens Settings Panel with Alert section selected and visible
showAlert(alertHeader, alertMessage, messageType, alertProperties)Creates Alert based on given parameters and displays it.
showAlertError(alertHeader, alertMessage)Creates an Adaptable Alert based on given parameters and displays it as Error Alert.
showAlertInfo(alertHeader, alertMessage)Creates an Adaptable Alert based on given parameters and displays it as Info Alert.
showAlertSuccess(alertHeader, alertMessage)Creates an Adaptable Alert based on given parameters and displays it as Succcess Alert.
showAlertWarning(alertHeader, alertMessage)Creates an Adaptable Alert based on given parameters and displays it as Warning Alert.
suspendAlertDefinition(alertDefinition)Suspends Alert Definition
suspendAllAlertDefinition()Suspends all Alert Definitions
unSuspendAlertDefinition(alertDefinition)Activates a suspended Alert Definition
unSuspendAllAlertDefinition()Activates all suspended Alert Definition

Alert Fired Event

The Alert Fired Event is published by AdapTable whenever an Alert is fired.