new ui/js/api/Notification()
stable API
UI notification descriptor support.
Helps creating notifications to be displayed to users. Notification can have various parameters - i.e. level (INFO, SUCCESS, WARNING, ...).
- Source:
- See:
Members
(static) Level :number
stable API
Notification levels.
Type:
- number
Properties:
Name | Type | Description |
---|---|---|
SUCCESS |
number | Success message. |
INFO |
number | Information message. |
WARNING |
number | Warning message. |
ERROR |
number | Error message. |
- Version:
- 15.4.5
- Source:
Methods
(static) create() → {ui/js/api/Notification}
stable API
Creates new notification instance.
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
parameters.message |
string | message to show |
||
parameters.level |
number |
<optional> |
Level.INFO | message level |
- Version:
- 15.4.5
- Source:
Returns:
Examples
var notification = Notification.create({
message: 'Ahoy'
});
var notification = Notification.create({
message: 'Ahoy',
level: Notification.Level.SUCCESS
});
level(level) → {ui/js/api/Notification}
stable API
Sets the notification level.
Parameters:
Name | Type | Description |
---|---|---|
level |
ui/js/api/Notification.Level | severity of the reporting to use |
- Version:
- 15.4.5
- Source:
Returns:
Examples
Notification.create().message('Beware').level(Notification.Level.WARNING);
var notification = Notification.create({message: 'OK'});
notification.level(Notification.Level.SUCCESS);
message(message) → {ui/js/api/Notification}
stable API
Sets the notification message.
Parameters:
Name | Type | Description |
---|---|---|
message |
string | message to show |
- Version:
- 15.4.5
- Source:
Returns:
Example
Notification.create().message('Ahoy');