ForgeComponents
el

Components

j-Notify

jComponent 20 · jcomponent@20 component Παράδειγμα φορτωμένο με jComponent 20

ΕΠΙΤΡΟΦΗ:

  • Το timeout {Number} πρέπει να περιέχει ένα χρονοδιάγραμμα (milliseconds) για τη λήξη της κοινοποίησης (προεπιλογή: 3000)
  • Το position {String} μπορεί να είναι top, top left, top right (επιλεγμένο), bottom, bottom left και bottom right

Μέθοδοι:

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

Δουλεύει με τον ΑΣΤΕΡ:

  • Τα λάθη αντιμετωπίζονται αυτόματα
// Without callback
AJAX('POST /api/profile/', userprofile, ASETTER('notify/response', 'Profile has been saved successfully'));

// Or with a callback
AJAX('POST /api/profile/', userprofile, ASETTER('notify/response', 'Profile has been saved successfully', function(response) {
	console.log(response);
}));

// Or with a callback and without notify
AJAX('POST /api/profile/', userprofile, ASETTER('notify/response', function(response) {
	console.log(response);
}));

// With auto-binding
AJAX('POST /api/profile/', userprofile, ASETTER('notify/response', '?.response'));
AJAX('POST /api/profile/', userprofile, ASETTER('notify/response', 'Your message', '?.response'));

Χρησιμοποιήστε το με <ui-component name="notify">Όταν το στοιχείο δεν έχει φορτωθεί ακόμα, jComponent Κατεβάστε το για πρώτη φορά από τη διεύθυνση DEF.fallback (Η Componentator Συγγραφέας: Peter Širka. πηγή: το Componentator Ετικέτες Αξιολόγηση, MIT άδεια.

example.html
<style>
	body { font-family: Arial; background-color: #F5F5F5; }
</style>

<ui-component name="notify"></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('notify/success', 'This is "success" message.');
	}, 1000);

	setTimeout(function() {
		SETTER('notify/warning', 'This is "warning" message.', 2);
	}, 2000);

	setTimeout(function() {
		SETTER('notify/info', 'This is "info" message.', 3);
	}, 3000);
</script>