The Alerts control creates non-intrusive alerts. The alert automatically closes based on the Defualt Auto-Close Delay configuration option (see below for more information), so that the user doesn't have to manually close the alert. However, the user also has the ability to manually close the alert.
Like almost all SPARK controls, you can trigger events that are fired when the user interacts with the control (see the Event and Methods sections below and the Event Handling article for more information).
Behavior
Alert Topic The topics the control should listen for. Use * to listen for alerts with unspecified topics. When no topics are specified the alert will listen for all unspecified topics (i.e. same as specifying * as the Alert Topic)
Default Auto-Close Delay Set how long (in milliseconds) each alert is displayed before closing
Appearance
Default Alert Color Style
Dark Style When selected, alert colors will be darker
No Vertical Spacing Show no vertical spacing between alerts
Animate When selected, alerts will slide into view. Otherwise, alerts will simply appear on the page.
Example
These are the configuration option settings...
The Decimal control has an On Change event that triggers the Alerts control to appear...
When the value entered in the Decimal control is greater than 500, the Alerts control will display on the page and will automatically close after 10,000 milliseconds, or before the specified time has elapsed, the user may manually close the alert by clicking the 'x' on the alert...
Events
With the Alerts control, there are 3 types of event handlers:
- On Alert Click When the alert is clicked
- On Alert Close When the alert is closed
- On Alert Expired When the alert's set default auto-close delay has expired
You can use JavaScript logic to affect the effects of the control, depending on the event. More information on using these controls can be found in the Event Handling article.
Methods
For detailed information on the available methods for this control, access the JS Doc file.
- Author: Courtney Silva
- Date Created: March 15, 2016
- Date Modified: March 15, 2016
Comments