Pular para o conteúdo principal

Alert

A sub namespace of UI, exclusive for alert operations

//accessing to ui.alert methods
SW.UI.Alert.{methodName}

clear

Description

This method can be used to clear a toastr that is being displayed.

Method(s)

1 function clear(): void

Basic Usage

SW.UI.Alert.clear(),

error

Description

This method can be used to show a Error toastr in the window and also in the console.

Method(s)

1   function error(
2 response: string | HttpErrorResponse,
3 params: {
4 documentName?: DocumentName,
5 userName?: string,
6 userId?: string,
7 onClick?: Function
8 } = {}
9 ): void
ParameterTypeRequiredDefaultsDescription
responsestring | HttpErrorResponsetrueThe message to be displayed in the alert
documentNameDocumentNamefalseDocument name
userNamestringfalseUser's name
userIdstringfalseUser's id
onClickFunctionfalseFunction executed when toastr is clicked

Basic Usage

SW.UI.Alert.error("Toast error");

Response

img


info

Description

This method can be used to show a Info toastr in the window and also in the console.

Method(s)

1 function info(message: string,
2 params: {
3 documentName?: DocumentName,
4 userName?: string,
5 userId?: string,
6 onClick?: Function
7 } = {}
8 ): void
ParameterTypeRequiredDefaultsDescription
messagestringtrueThe message to be displayed in the alert
documentNameDocumentNamefalseDocument name
userNamestringfalseUser's name
userIdstringfalseUser's id
onClickFunctionfalseFunction executed when toastr is clicked

Basic Usage

SW.UI.Alert.info("Toast info");

Response

img


success

Description

This method can be used to show a Success toastr in the window and also in the console.

Method(s)

1   function success(
2 message: string,
3 params: {
4 documentName?: DocumentName,
5 userName?: string,
6 userId?: string,
7 onClick?: Function
8 } = {}
9 ): void
ParameterTypeRequiredDefaultsDescription
messagestringtrueThe message to be displayed in the alert
documentNameDocumentNamefalseDocument name
userNamestringfalseUser's name
userIdstringfalseUser's id
onClickFunctionfalseFunction executed when toastr is clicked

Basic Usage

SW.UI.Alert.success("Toast success");

Response

img


warning

Description

This method can be used to show a Warning toastr ine the window and also in the console.

Method(s)

1   function warning(message: string,
2 params: {
3 documentName?: DocumentName,
4 userName?: string,
5 userId?: string,
6 onClick?: Function,
7 timeOut?: number
8 } = {
9 timeOut: this.DEFAULT_TIMEOUT
10 }
11 ): void
ParameterTypeRequiredDefaultsDescription
messagestringtrueThe message to be displayed in the alert
documentNameDocumentNamefalseDocument name
userNamestringfalseUser's name
userIdstringfalseUser's id
onClickFunctionfalseFunction executed when toastr is clicked
timeOutnumberfalse5500Display time of the toastr

Basic Usage

SW.UI.Alert.warning("User field is required");

Response

img