ForgeKomponenty
cs

Komponenty

j-NotifyBar

jComponent 20 · jcomponent@20 component Příklad načten s jComponent 20
  • singleton
  • Úspěšná zpráva SETTER('notifybar/success', 'MESSAGE')
  • Poznámka k SETTER('notifybar/warning', 'MESSAGE')
  • Informace o SETTER('notifybar/info', 'MESSAGE', '[BUTTON_LABEL]', [callback_dismiss])

Konfigurace:

  • timeout {Číslo} Časový výstup v milisekundách (předvolený: 4000)

Metody:

  • component.success(message) přináší zprávu o úspěchu
  • component.warning(message) přináší upozornění
  • component.info(message) přináší informační zprávu
  • component.hide() ukrývá bar
  • component.show() ukazuje poslední zprávu

Práce s asetrem:

  • Chyby se řeší automaticky
// 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'));

Použijte ji s <ui-component name="notifybar">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.

example.html
<ui-component name="notifybar"></ui-component>

Lorem ipsum dolor sit amet, consectetur adipisicing elit. Quia harum accusamus debitis aut sunt, deserunt magni alias neque unde reprehenderit ipsa ea laboriosam eveniet! Distinctio pariatur sed, a aut nobis.

<script>
	setTimeout(function() {
		SETTER('notifybar/success', 'Lorem ipsum dolor sit amet.');
	}, 1000);

	setTimeout(function() {
		SETTER('notifybar/warning', 'Lorem ipsum dolor sit amet.');
	}, 2000);
</script>