Web Component: j-NotifyBar
j-NotifyBar
singleton
success message
SETTER('notifybar/success', 'MESSAGE')
warning message
SETTER('notifybar/warning', 'MESSAGE')
info message
SETTER('notifybar/info', 'MESSAGE', '[BUTTON_LABEL]', [callback_dismiss])
jComponent
v19|v20
Configuration:
timeout
{Number} A timeout in milliseconds (default:4000
)
Methods:
component.success(message)
appends success messagecomponent.warning(message)
appends warning messagecomponent.info(message)
appends info messagecomponent.hide()
hides the barcomponent.show()
shows last message
Works with ASETTER:
- errors are handled automatically
// Without callback
AJAX('POST /api/profile/', userprofile, ASETTER('notifybar/response', 'Profile has been saved successfully'));
// Or with a callback
AJAX('POST /api/profile/', userprofile, ASETTER('notifybar/response', 'Profile has been saved successfully', function(response) {
console.log(response);
}));
// Or with a callback and without message
AJAX('POST /api/profile/', userprofile, ASETTER('notifybar/response', function(response) {
console.log(response);
}));
// With auto-binding
AJAX('POST /api/profile/', userprofile, ASETTER('notifybar/response', '?.response'));
AJAX('POST /api/profile/', userprofile, ASETTER('notifybar/response', 'Your message', '?.response'));
Author
- Peter Širka petersirka@gmail.com
- License
Created
09. march 2020
Updated
01. february 2023
jComponent library
19 | 20
Version
v1
License
https://www.totaljs.com/license/
Dark mode
Yes
Responsive
No
Author
Peter Širka
Email
petersirka@gmail.com