Options
All
  • Public
  • Public/Protected
  • All
Menu

The Predefined Configuration for the Alert function

Alerts will notify you when something changes that you do need to be notified about (based on an Alert Definition).

This can be either the result of an edit the user makes, or it can be ticking data.

You can select the type of the Alert (e.g. Success, Warning, Error etc.) and where it appears.


Further AdapTable Help Resources


Alert Predefined Config Example

export default {
Alert: {
   MaxAlertsInStore: 10,
   AlertDefinitions: [
   {
     ColumnId: 'InvoicedCost',
     MessageType: 'Warning',
     Range: {
       Operand1: '2000',
       Operand1Type: 'Value',
       Operand2: '',
       Operand2Type: 'Value',
       Operator: 'GreaterThan',
     },
     AlertProperties: {
      ShowPopup: true,
     },
   },
   {
     ColumnId: 'ItemCount',
     MessageType: 'Info',
     Range: {
       Operand1: '100',
       Operand1Type: 'Value',
       Operand2: '',
       Operand2Type: 'Value',
       Operator: 'PercentChange',
     },
     AlertProperties: {
      ShowPopup: true,
     },
    },
  ],
},
} as PredefinedConfig;

In this example we have created 2 Alert Definitions:

  • On the InvoicedCost column which will warn (and show a popup) when the value is > 2000 (and display a popup).

  • On the ItemCount column which will show info alert (but not show a popup) if the new value is more than double (i.e. has percent change > 100).

Hierarchy

Index

Properties

Optional AlertDefinitions

AlertDefinitions: AlertDefinition[]

A collection of Alert Definitions - which will trigger Alerts when their condition is met

Default Value: Empty array

Optional AlertDisplayDiv

AlertDisplayDiv: string

The name of a div in which you want alerts to display.

Leave unset if you want them never to show in a

.

This property is only used if the Alert itself being displayed has ShowInDiv set to true.

Default Value: Empty string

Optional MaxAlertsInStore

MaxAlertsInStore: number

How many alerts to hold in the State at any one time. If you reacch this limit then we remove the oldest alert each time a new one is triggered.

Default Value: 20

Optional Revision

Revision: number

The 'version' number of the Item.

Used for when developers want to update one section in Predefined Config while keeping others unchanged.

If the Revision number in Predefined Config is greater than the one stored in the User's state, then the section in Predefined Config will be used, and will replace the State.

If the Revision number in Predefined Config is not greater than the one stored in the User's state, then it is ignored as its already been passed into the User's state (and potentially superseded).

See Adaptable State Guide for more information.

Note: This is the only property in ConfigState - the base class for all Adaptable State objects.

Generated using TypeDoc