# j-NotifyBar

> j-NotifyBar: singleton; succesbericht SETTER ('notifybar/success', 'MESSAGE')

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

- Singleton
- Succesbericht `SETTER('notifybar/success', 'MESSAGE')`
- Waarschuwingsbericht `SETTER('notifybar/warning', 'MESSAGE')`
- Informatie over `SETTER('notifybar/info', 'MESSAGE', '[BUTTON_LABEL]', [callback_dismiss])`


__Configuratie__:

- `timeout` {Nummer} Een tijduitgang in milliseconden (default: `4000`)

__Methoden__:

- `component.success(message)` geeft succesbericht
- `component.warning(message)` geeft waarschuwingsbericht
- `component.info(message)` geeft informatie aan
- `component.hide()` verbergt de bar
- `component.show()` laat het laatste bericht zien

__Werken met Aster__:

- De fouten worden automatisch verwerkt

```javascript
// Without callback
AJAX('POST /api/profile/', userprofile, ASETTER('notifybar/response', 'Profile has been saved successfully'));

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

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

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

Gebruik het met `<ui-component name="notifybar">`Wanneer de component nog niet is geladen, jComponent Download het op eerste gebruik van het adres in `DEF.fallback` (De Componentator Schrijver: Peter Širka. bron: de Componentator Componenten repository, MIT licentie.

```html example.html
<ui-component name="notifybar"></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('notifybar/success', 'Lorem ipsum dolor sit amet.');
	}, 1000);

	setTimeout(function() {
		SETTER('notifybar/warning', 'Lorem ipsum dolor sit amet.');
	}, 2000);
</script>
```
