ForgeKomponenty
cs

Komponenty

j-FileUploadList

jComponent 20 · jcomponent@20 component Příklad načten s jComponent 20

Tato složka může nahrát soubory a výsledek se přidá do modelu. array.

Konfigurace:

  • url {String} URL ke stažení (předvolené: /api/upload/)
  • accept {String} Volitelný, typ obsahu pro filtrování souborů např. image/*
  • multiple {Boolean} Volitelné, umožňuje více souborů (podle předvolby: true)
  • progress {String} cesta k function(percentage)
  • text {String} klíčové jméno pro renderování hodnoty text (předvolené: name)

Modelka:

Server musí vrátit Array ve formě níže:

[
	{
		name: String,
		length: Number,
		url: String
	}
]

Použijte ji s <ui-component name="fileuploadlist">Pokud je součástka ještě nezačleněna, jComponent Stáhnout ji na první použití z adresy DEF.fallback a) The Componentator CDN dle předvolby. autor: Peter Širka. zdroj: Componentator Výrobce je autorizován, MIT licence.

example.html
<ui-component name="fileuploadlist" path="files"></ui-component>
<br />
<div><a href="javascript:browsefiles()">Upload files</a></div>

<script>
	var files = [];
	files.push({ name: 'repeater.html', length: 2676, url: '/download/16753-1467713967-repeater.html' });
	files.push({ name: 'snapshot.js', length: 507, url: '/download/16754-168632909-snapshot.js'});
	files.push({ name: 'tracking-cms.gif', length: 974730, url: '/download/16755-1806731401-tracking-cms.gif' });

	function browsefiles() {
		SETTER('fileuploadlist', 'browse');
	}
</script>