# j-ImportCSV

> Output of this component is mapped array. The component uses j-Directory component.

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

Output of this component is mapped array. The component uses `j-Directory` component.


__Configuration__:

- __IMPORTANT__ `datasource {String}` a path to CSV data (`String` type)
- `skipfirst {Boolean}` skips the first parsed line (default: `true`)
- `notdefined {String}` a text for undefined columns (default: `---`)
- `parent {String}` jQuery selector for obtaining of width/height (default: `parent`)
- `dirsearch {String}` a placeholder for search field (default: `Search`)
- `margin {Number}` a margin for `parent` (default: `0`)
- `marginxs {Number}` optional, a top/bottom margin together for `xs` screen width
- `marginsm {Number}` optional, a top/bottom margin together for `sm` screen width
- `marginmd {Number}` optional, a top/bottom margin together for `md` screen width
- `marginlg {Number}` optional, a top/bottom margin together for `lg` screen width

Use it with `<ui-component name="importcsv">`. When the component is not loaded yet, jComponent downloads it on first use from the address in `DEF.fallback` (the Componentator CDN by default). Author: Peter Širka. Source: the Componentator components repository, MIT license.

```html example.html
<ui-component name="directory"></ui-component>

<div style="width:500px;height:300px">
	<ui-component name="importcsv" path="output" config="datasource:data;keys:firstname=First name,lastname=Last name,email=Email;skipfirst:0"></ui-component>
	<ui-bind path="output" config="html b:value ? value.length : 0" class="block help">Total items for import: <b>0</b></ui-bind>
</div>

<script>

	var data = `Peter;Širka;peter@totalavengers.com\nTomáš,Novák,tomas@totalavengers.com\nDenis,Granec,denis@totalavengers.com`;
	var output = [];

</script>
```
