j-ImportCSV
Output of this component is mapped array. The component uses j-Directory component.
Configuration:
- IMPORTANT
datasource {String}a path to CSV data (Stringtype) 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 forparent(default:0)marginxs {Number}optional, a top/bottom margin together forxsscreen widthmarginsm {Number}optional, a top/bottom margin together forsmscreen widthmarginmd {Number}optional, a top/bottom margin together formdscreen widthmarginlg {Number}optional, a top/bottom margin together forlgscreen 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.
<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>