ForgeKomponenty
pl

Komponenty

j-Message

jComponent 20 · jcomponent@20 component Przykład załadowany z jComponent 20
  • Singleton

Konfiguracja:

  • button {String} etykieta przycisków (default: OK)
  • style {Number} może zmienić styl (default: 1), styl 2 jest podobny do komponentu j-Approve
  • closeoutside {Boolean} umożliwia zamknięcie pola wiadomości, klikając poza głównym przyciskiem

Używanie:

SETTER('message/warning', 'Some warning');
SETTER('message/success', 'Some success message');
SETTER('message/info', 'Some info message');

Praca z asystentem:

  • Błędy są automatycznie popełnione
// 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'));

Użyj go z <ui-component name="message">Gdy element nie jest jeszcze ładowany, jComponent Pobierz go po pierwszym użyciu z adresu DEF.fallback (Wydaje się Componentator Autor: Peter Širka Źródło: Componentator Zestaw składników, licencja MIT.

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

<script>
	setTimeout(function() {
		SETTER('message/success', 'Success message');
		// SETTER('message/warning', 'Warning message');
	}, 2000);
</script>