ForgeKomponensek
hu

Komponensek

j-NotifyBar

jComponent 20 · jcomponent@20 component Példa betöltve a jComponent 20-szal
  • Szingapúr
  • A sikertörténet SETTER('notifybar/success', 'MESSAGE')
  • Figyelmeztető üzenet SETTER('notifybar/warning', 'MESSAGE')
  • Információk SETTER('notifybar/info', 'MESSAGE', '[BUTTON_LABEL]', [callback_dismiss])

konfiguráció:

  • timeout {Number} A millisekundákban eltelt idő (default: 4000)

módszerek:

  • A component.success(message) sikeres üzenet
  • component.warning(message) figyelmeztető üzenet
  • A component.info(message) az információs üzenet
  • A component.hide() elrejti a barot
  • A component.show() az utolsó üzenetet mutatja

Az aszterrel dolgozik:

  • A hibák automatikusan kezelhetők
// 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'));

Használja a <ui-component name="notifybar">Amennyiben a készülék még nem tölthető le, jComponent letöltés az első felhasználásra a címről DEF.fallback (Azt a Componentator A szerző: Peter Širka. forrás: a Componentator Az összetevők raktár, MIT licenc.

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>