# j-View

> Tento komponent môže byť užitočný pre opakovane použiteľné zobrazenia v intranetových aplikáciách. Komponent zabalí pohľad do izolovaného rozsahu a hodnota podľa cesty komponentu sa použije ako model pre v

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

Tento komponent môže byť užitočný pre opakovane použiteľné zobrazenia v intranetových aplikáciách. Komponent zabalí pohľad do izolovaného rozsahu a ako model pre pohľad sa použije hodnota podľa cesty komponentu.


__Konfigurácia__:

- `url {String}` URL adresa zobrazenia (súbor `.html`)
- vyrovnávacia pamäť sťahovania `cache {String}` (predvolené: `session`)

### Použitie

__app.html__:

```html
<ui-component name="view" path="some.path" config="url:view.html"></ui-component>

- you can use an unlimited count of the same views (identifier is URL address)
- each view will have an independent scope/plugin

Example:
<ui-component name="view" path="some.path" config="url:view.html"></ui-component>
<ui-component name="view" path="some.path" config="url:view.html"></ui-component>
<ui-component name="view" path="some.path" config="url:view.html"></ui-component>
<ui-component name="view" path="some.path" config="url:view.html"></ui-component>
<ui-component name="view" path="some.path" config="url:view.html"></ui-component>
```

__view.html__:

```html
<div>
	<h1><ui-bind path="?.name" config="text"></ui-bind></h1>
	<button class="exec" data-exec="?/uppercase">To upper-case</button>
</div>

<script>
	// Plugin is optional
	// Name of the plugin is internally generated randomly
	PLUGIN(function(exports) {

		// Optional
		// Is executed only one-time
		exports.init = function(el) {
			// @el {jQuery element}
		};

		exports.uppercase = function() {
			var model = GET('?');
			model.name = model.name.toUpperCase();
			UPD('?.name');
		};

	});
</script>
```

Použite ho so `<ui-component name="view">`. Keď komponent ešte nie je načítaný, jComponent ho stiahne pri prvom použití z adresy v `DEF.fallback` (predvolene CDN Componentator). Autor: Peter Širka. Zdroj: úložisko komponentov Componentator, licencia MIT.

```html example.html
<div class="container">
	<div class="row">
		<div class="col-xs-4">
			<ui-component name="view" path="a" config="url:https://cdn.componentator.com/examples/view.html"></ui-component>
		</div>
		<div class="col-xs-4">
			<ui-component name="view" path="b" config="url:[view]"></ui-component>
		</div>
		<div class="col-xs-4">
			<ui-component name="view" path="c" config="url:[view]"></ui-component>
		</div>
	</div>
</div>

<script>

	ENV('view', 'https://cdn.componentator.com/examples/view.html');

	var a = { name: 'Total.js' };
	var b = { name: 'Express.js' };
	var c = { name: 'Meteor.js' };

</script>
```
