j-Message
- singleton
Konfigurace:
button {String}a tlačítko štítky (předvolené:OK)style {Number}může změnit styl (podle předvolby:1), styl2je podobný složcej-Approvecloseoutside {Boolean}umožňuje uzavření zprávy kliknutím mimo hlavní tlačítko
Použití:
SETTER('message/warning', 'Some warning');
SETTER('message/success', 'Some success message');
SETTER('message/info', 'Some info message');Práce s asetrem:
- Chyby se řeší 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žijte ji s <ui-component name="message">Pokud je součástka ještě nezačleněna, jComponent Stáhnout ji na první použití z adresy DEF.fallback a) The Componentator CDN dle předvolby. autor: Peter Širka. zdroj: Componentator Výrobce je autorizován, MIT licence.
<ui-component name="message"></ui-component>
<script>
setTimeout(function() {
SETTER('message/success', 'Success message');
// SETTER('message/warning', 'Warning message');
}, 2000);
</script>