CSV Importer New

The CSV importer provides an easy way for your users to import a general CSV file with an unknown column order into your javascript grid or spreadsheet.

Author

Jspreadsheet Pro Team.

License

Available on the premium or enterprise plan.

Installation

Please choose one of the following options


Using CDN
Using NPM
<html>
<script src="https://jspreadsheet.com/v9/jspreadsheet.js"></script>
<script src="https://jsuites.net/v4/jsuites.js"></script>
<link rel="stylesheet" href="https://jspreadsheet.com/v9/jspreadsheet.css" type="text/css" />
<link rel="stylesheet" href="https://jsuites.net/v4/jsuites.css" type="text/css" />
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Material+Icons" />

<script src="https://cdn.jsdelivr.net/npm/lemonadejs/dist/lemonade.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/@jspreadsheet/importer/dist/index.min.js"></script>

<div id='spreadsheet'></div>

<script>
// License for Formula Plugin
jspreadsheet.license = 'your-license';

// Add-on for Jspreasheet
jspreadsheet.setExtensions({ importer });

// Create the spreadsheets
jspreadsheet(document.getElementById('spreadsheet'), {
    toolbar: true,
    worksheets: [
        { minDimensions: [6, 8] },
    ],
});
</script>
</html>
// Jspreadsheet Pro
import jspreadsheet from 'jspreadsheet';

// Import extension
import importer from '@jspreadsheet/importer';

// Add a valid license
jspreadsheet.setLicense('your-license');

// Start the JSS plugin
jspreadsheet.setExtensions({ importer });

// Create a spreadsheet
jspreadsheet(document.getElementById('spreadsheet'), {
    toolbar: true,
    worksheets: [
        { minDimensions: [6, 8] },
    ]
});


Example

This extension adds a new button on the toolbar. Click to import a new CSV file from your computer.



Translation

It is possible to translate this extension using the following code.
jSuites.setDictionary({
    'CSV column': 'Coluna CSV',
    'Spreadsheet column': 'Coluna da Planilha',
    'Import loaded records': 'Importar os registros carregados',
    'Load a new CSV file': 'Carregar um novo arquivo CSV',
    'Advanced CSV': 'CSV Avan├žado',
    'Import CSV': 'Importar CSV',
})