# j-NotificationsPanel

> j-NotificationsPanel: facile da usare; singletone

Framework: jcomponent20
Product: jComponent 20 (jcomponent@20)
Language: it
Content-SHA256: d62e0c7302bc73f7c779b3862f18a1180ad7802b5068c09be347b61f0e9b748e
Snapshot: c0700e321579725c5cf4f5ace1ad7d2866d1b4f93c24a63c0b41b6b7998e976c
Sources: components@910ed1a86f6e72b4f031d3ad0dc7844f9fc5cb8e
Review: not-recorded

- singolo
- Imparare dall’esempio


__Configurazione__:

- `top {Number}` Top Offset (default: `0`)
- `visibleY {Boolean}` mostra Y scrollbars (default: `true`)
- Titolo `title {String}` nel pannello di notifica (default: `Notifications`)
- `autoremove {Boolean}` rimuove le notifiche dopo aver cliccato su di esso (default: `true`)
- `click {String}` un percorso per il metodo `function(obj, el)` quando l'utente fa clic sulle notifiche
- `exec {String}` un percorso per il metodo `function(render(ARR_OF_OBJECT))` quando l'utente vuole mostrare le notifiche

Utilizzare con `<ui-component name="notificationspanel">`Quando il componente non è ancora caricato, jComponent Scarica il codice in prima utilizzazione dall'indirizzo `DEF.fallback` (Il Componentator La storia di Peter Širka.Fonte: il Componentator Ristorante dei componenti, licenza MIT.

```html 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>
```
