Toast Notifications
Summary
- Toast Notifications are a configurable way to display messsages
- They can include Forms if required
- Toast Notifications are used in Alerts and System Status Messages
Toast Notifications are rich, highly configurable popup messages.
They are designed to inform users of important messages or updates.
Toast Notifications are available - as options - in 2 modules in AdapTable:
Note
- Alert Notifications can be configured to show an Alert Form (i.e. buttons and other Form fields)
- System Status toasts are typically message text plus a default OK button unless you customise the underlying alert
Notifications in AdapTable
- This example demonstrates some of the Notification functionality available in AdapTable, including:
- System Status Messages which can be set via 4 buttons in the Custom Toolbar, and which display the message in the System Status Toolbar
- TODO JW - create a Scheduled Alert which will fire after button is clicked in Custom Toolbar
- Toast Notifications which display at the top (rather than the default bottom left) of the grid with a bounce effect and 8 second duration
Try It Out
- Click the buttons in the Setting Message Buttons Toolbar to see the System Status Message change
Configuring Notifications
By default a Toast Notification will:
- appear with a sliding action
- be positioned in the BottomRight of the screen
- remain on the screen for 3 seconds
- display without a progress bar
- not be draggable
- not close when it is clicked
However all these settings are configurable in Notifications Options.
Caution
- These Options are global in AdapTable
- Changes affect all Toast Notifications (i.e. in both Alerts and System Status Messages)
Toast Notifications
- This demo sends System Status messages in the same way as the demo above.
- However we have overridden some of the default Toast Notification properties as follows:
position: 'TopCenter'duration: 5000transition: 'Bounce'showProgressBar: truecloseWhenClicked: truepauseWhenHovering: true
Notifications Options
Toast Notifications are configured in NotificationsOptions.
closeWhenClicked
Default: falseBooleanCloses Notification automatically when its clicked
duration
Default: 3000Number | 'always'Determines how long a Toast Notification will be displayed
isDraggable
Default: falseBooleanWhether a Toast Notification can be dragged to a new location
maxNotifications
Default: 3NumberHow many Notifications can be displayed at one time
pauseWhenHovering
Default: falseBooleanPauses the Notification when mouse hovers over it
Where the Notification will appear
showApplicationIcon
Default: falseBooleanDisplays the application icon in Notifications
showProgressBar
Default: falseBooleanDisplays a Progress Bar in a Toast Notification
transition
Default: Slide'Bounce' | 'Slide' | 'Zoom' | 'Flip'How a Toast Notification will first appear
The full list of properties in Notifications Options is:
| Property | Type | Description | Default |
|---|---|---|---|
| closeWhenClicked | boolean | Closes Notification automatically when its clicked | false |
| duration | number | 'always' | How long (in ms) Notifications display for | 3000 |
| isDraggable | boolean | Can Notification be dragged | false |
| maxNotifications | number | How many Notifications can be displayed at one time | 3 |
| maxSystemMessagesInStore | number | How many System Status Messages to hold in State; when limit is reached, oldest Message is removed | 100 |
| pauseWhenHovering | boolean | Pauses the Notification when mouse hovers over it | false |
| position | ToastPositions | Where Notification will appear (if anywhere) | 'BottomRight' |
| showApplicationIcon | boolean | Displays the application icon in Notifications | false |
| showProgressBar | boolean | Shows a Progress Bar in the Notification | false |
| showSystemStatusMessageNotifications | boolean | Display System Status Messages as Notifications | false |
| transition | 'Bounce' | 'Slide' | 'Zoom' | 'Flip' | How Notification will appear: Bounce, Slide, Zoom or Flip | 'Slide' |