Handsontable example

by Aleksandra Maria Budnik

HTML

<div id="example1"></div>

<button id="export-file" class="intext-btn">
    Export as a file
  </button>

CSS

</style>

<script src="https://cdn.jsdelivr.net/npm/handsontable@8.0.0/dist/handsontable.full.min.js"></script>
<link type="text/css" rel="stylesheet" href="https://cdn.jsdelivr.net/npm/handsontable@8.0.0/dist/handsontable.full.min.css">

JavaScript

var myRows= Array.from(Array(1001).keys())
  console.log(myRows);
  var example = document.getElementById('example1');
  var hot = new Handsontable(example, {
    data: Handsontable.helper.createSpreadsheetData(10000, 10),
    colWidths: 100,
    width: '100%',
    height: 320,
    rowHeights: 23,
    rowHeaders: true,
    colHeaders: true,
    hiddenRows: {
			rows: myRows
    }
  });

document.getElementById('export-file').addEventListener('click', function() {
    hot.getPlugin('exportFile').downloadFile('csv', {
      filename: 'MyFile'
    });
  });