ForgeComponents
el

Components

j-NotificationsPanel

jComponent 20 · jcomponent@20 component Παράδειγμα φορτωμένο με jComponent 20
  • Σιγκλέτο
  • Μάθετε από το παράδειγμα

ΕΠΙΤΡΟΦΗ:

  • Πρώτη τιμή top {Number} (προεπιλεγμένη τιμή: 0)
  • visibleY {Boolean} εμφανίζει Y scrollbars (προεπιλεγμένο: true)
  • Ο τίτλος title {String} στο πίνακα ειδοποιήσεων (προεπιλογή: Notifications)
  • Το autoremove {Boolean} αφαιρεί τις ειδοποιήσεις μετά από κλικ σε αυτό (προεπιλεγμένο: true)
  • click {String} μια διαδρομή προς τη μέθοδο function(obj, el) όταν ο χρήστης κάνει κλικ στις ειδοποιήσεις
  • exec {String} μια διαδρομή προς τη μέθοδο function(render(ARR_OF_OBJECT)) όταν ο χρήστης θέλει να εμφανίσει τις ειδοποιήσεις

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

example.html
<ui-component name="notificationspanel" path="shownotifications" config="exec:loadnotifications;click:clicknotificiation">
	<script type="text/html">
		<h2>{{ name }}</h2>
		<p>{{ body }}</p>
		<hr />
	</script>
</ui-component>

<script>

	var shownotifications = false;

	// Shows notifications panel after 2 seconds
	SET('shownotifications', true, 2000);

	// The method will be executed automatically before the notifications panel will be visible
	function loadnotifications(render) {
		var arr = [];
		arr.push({ name: 'Name of notifications 1', body: 'Lorem ipsum dolor sit amet, consectetur adipisicing elit. Quos, architecto!' });
		arr.push({ name: 'Name of notifications 2', body: 'Lorem ipsum dolor sit amet, consectetur adipisicing elit. Quos, architecto!' });
		arr.push({ name: 'Name of notifications 3', body: 'Lorem ipsum dolor sit amet, consectetur adipisicing elit. Quos, architecto!' });

		// IMPORTANT:
		// This renders notifications onto notifications panel
		render(arr);
	}

	function clicknotificiation(obj) {
		console.log('CLICK', obj);
	}

</script>