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
Parameter | Type | Required | Defaults | Description |
---|---|---|---|---|
response | string | HttpErrorResponse | true | The message to be displayed in the alert | |
documentName | DocumentName | false | Document name | |
userName | string | false | User's name | |
userId | string | false | User's id | |
onClick | Function | false | Function executed when toastr is clicked |
Basic Usage
SW.UI.Alert.error("Toast error");
Response
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
Parameter | Type | Required | Defaults | Description |
---|---|---|---|---|
message | string | true | The message to be displayed in the alert | |
documentName | DocumentName | false | Document name | |
userName | string | false | User's name | |
userId | string | false | User's id | |
onClick | Function | false | Function executed when toastr is clicked |
Basic Usage
SW.UI.Alert.info("Toast info");
Response
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
Parameter | Type | Required | Defaults | Description |
---|---|---|---|---|
message | string | true | The message to be displayed in the alert | |
documentName | DocumentName | false | Document name | |
userName | string | false | User's name | |
userId | string | false | User's id | |
onClick | Function | false | Function executed when toastr is clicked |
Basic Usage
SW.UI.Alert.success("Toast success");
Response
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
Parameter | Type | Required | Defaults | Description |
---|---|---|---|---|
message | string | true | The message to be displayed in the alert | |
documentName | DocumentName | false | Document name | |
userName | string | false | User's name | |
userId | string | false | User's id | |
onClick | Function | false | Function executed when toastr is clicked | |
timeOut | number | false | 5500 | Display time of the toastr |
Basic Usage
SW.UI.Alert.warning("User field is required");