# j-Features

> j-Features: tylko dla komputerów stacjonarnych; singleton

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

- Tylko dla komputerów desktopowych
- Singleton
- Zastosowanie systemu Bootstrap Grid

### Metody

Metoda: `component.open(opt)`

- `opt.placeholder {String}` miejsce do wejścia wyszukiwania (default: `config.placeholder`)
- `opt.items {Object Array}` z listą funkcji (wymagane):
    - `name {String}` nazwa charakterystyczna
    - `icon {String}` (opcjonalny) ikona bez `fa-`
    - `keywords {String}` (opcjonalne) dodatkowe słowa kluczowe do wyszukiwania
    - `value {Object/String/Number}` wartość
- `opt.scrolltop {Boolean}` skręca się do góry, aż wyświetla okno (default: `false`)
- `opt.callback(selected) {Function}` to zwrot, który jest nazywany, gdy użytkownik kliknie na niektóre funkcje. argument `selected` zawiera wybrane elementy.

Metoda: `component.hide()`

__Konfiguracja__:

- `placeholder {String}` miejsce dla wejścia wyszukiwania
- Wysokość `height {Number}` elementu listy (opcjonalny, standardowy `35`)

Użyj go z `<ui-component name="features">`Gdy element nie jest jeszcze ładowany, jComponent Pobierz go po pierwszym użyciu z adresu `DEF.fallback` (Wydaje się Componentator Autor: Peter Širka Źródło: Componentator Zestaw składników, licencja MIT.

```html example.html
<style>
	body { background-color: #F0F0F0; }
</style>

<ui-component name="features" config="placeholder:Search ..."></ui-component>

<div class="container">
	<a href="javascript:features()">Show features</a>
</div>

<script>
	function features() {
		var opt = {};
		opt.items = [{ name: 'Dashboard' }, { name: 'Invoices' }, { name: 'Orders' }, { name: 'Products' }, { name: 'Pages' }, { name: 'Notes' }, { name: 'Users', icon: 'user' }, { name: 'Settings' }];
		opt.callback = function(selected) {
			console.log('CLICK', selected);
		};
		SETTER('features/show', opt);
	}
	setTimeout(features, 500);
</script>
```
