j-Message
- singleton
Konfigurácia:
button {String}štítok tlačidla (predvolené:OK)style {Number}môže zmeniť štýl (predvolené:1), štýl2je podobný komponentuj-Approvecloseoutside {Boolean}umožňuje zatvorenie schránky správ kliknutím mimo hlavného tlačidla
Použitie:
SETTER('message/warning', 'Some warning');
SETTER('message/success', 'Some success message');
SETTER('message/info', 'Some info message');Funguje s ASETTER:
- chyby sa riešia automaticky
// Without callback
AJAX('POST /api/profile/', userprofile, ASETTER('message/response', 'Profile has been saved successfully'));
// Or with a callback
AJAX('POST /api/profile/', userprofile, ASETTER('message/response', 'Profile has been saved successfully', function(response) {
console.log(response);
}));
// Or with a callback and without message
AJAX('POST /api/profile/', userprofile, ASETTER('message/response', function(response) {
console.log(response);
}));
// With auto-binding
AJAX('POST /api/profile/', userprofile, ASETTER('message/response', '?.response'));
AJAX('POST /api/profile/', userprofile, ASETTER('message/response', 'Your message', '?.response'));Použite ho so <ui-component name="message">. Keď komponent ešte nie je načítaný, jComponent ho stiahne pri prvom použití z adresy v DEF.fallback (predvolene CDN Componentator). Autor: Peter Širka. Zdroj: úložisko komponentov Componentator, licencia MIT.
<ui-component name="message"></ui-component>
<script>
setTimeout(function() {
SETTER('message/success', 'Success message');
// SETTER('message/warning', 'Warning message');
}, 2000);
</script>