Alert

The Alert control provides brief messages to users, indicating different severity levels. These messages can include icons and colors to convey the importance and context of the information.

Properties

content String

Defines the content to be displayed within the alert.

Default: ""

cssClass String

Defines CSS classes to customize the appearance of alert.

Default: ""

enableRtl Boolean

Defines whether to render the component in right to left direction.

Default: false

enableState Boolean

Specifies whether to persist the state of the control between page loads.

Currently setting this value to true has no effect on the state of the component. The alert does not have any state properties.

Default: false

locale String

Specifies the culture and localization value for this control, overriding the globally defined value.

Default: en-US

severity String Severity

Defines the severity of the alert. Depending on the specified severity, the icon and colors will be rendered accordingly.

Default: Normal

showCloseIcon Boolean

Defines whether the show or hide the close icon in the alert. When true the close icon is displayed on the right edge of the alert. When clicked the alert will be closed.

Default: false

showIcon Boolean

Specifies whether to show or hide the icon representing the severity in the alert. When true the icon is displayed to the left of the content.

Default: true

variant String Variant

Specifies the variant that controls the appearance of the alert.

Default: Variant.Text

visible Boolean

Specifies whether the alert is visible to the user or not.

Default: true

Methods

addEventListener

Attaches an event handler to a specified element. This method allows you to set up a function that will be called whenever the specified event is delivered to the target element.

Parameter Type Description
eventName String A string value that specifies the name of the event.
handler Function Specifies the function to run when the event is triggered.

Returns: Void

appendTo

Appends the control to the specified HTML element.

Parameter Type Description
selector String HTMLElement The select to a specified HTML element or an HTML element where the control will be appended to.

Returns: Void

dataBind

Applies all pending property changes to the control.

Returns: Void

destroy

Destroys the Aware instance, detaches all related events, removes attributes, css classes and restores the root element.

Returns: Void

getLocalData

Gets the current properties values for the accordion that will be persisted to the state.

Returns: String

getRootElement

Gets the root element of the control.

Returns: HTMLElement

getStateData

Gets the current persisted state data for the control.

Returns: String

refresh

Applies all pending property changes to the accordion and re-renders the control.

Returns: Void

removeEventListener

Removes the attached event handler for the specified event listener.

Parameter Type Description
eventName String A string value that specifies the name of the event to be removed.
handler Function Specifies the function to be removed.

Returns: Void

Events

closed EmitType<AlertCloseEventArgs>

Event callback that is raised when the alert is closed.

created EmitType<CreatedEventArgs>

Event callback that is raised when the control has been created.

destroyed EmitType<Object>

Event callback that is raised when the control has been destroyed.