# j-NotificationsPanel

> j-NotificationsPanel: fácil uso; singleton

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

- singleton
- aprende del ejemplo


__Configuración__:

- `top {Number}` desplazamiento superior (predeterminado: `0`)
- `visibleY {Boolean}` muestra barras de desplazamiento Y (predeterminado: `true`)
- Título `title {String}` en el panel de notificaciones (predeterminado: `Notifications`)
- `autoremove {Boolean}` elimina las notificaciones después de hacer clic en ellas (predeterminado: `true`)
- `click {String}` una ruta al método `function(obj, el)` cuando el usuario hace clic en las notificaciones
- `exec {String}` una ruta al método `function(render(ARR_OF_OBJECT))` cuando el usuario quiere mostrar las notificaciones

Úselo con `<ui-component name="notificationspanel">`. Cuando el componente aún no está cargado, jComponent lo descarga en el primer uso desde la dirección en `DEF.fallback` (la CDN Componentator de forma predeterminada). Autor: Peter Širka. Fuente: repositorio de componentes Componentator, licencia 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>
```
