官方文档:
const container = document.getElementById('example');
const hot = new Handsontable(container, {
data: getData()
});
// access to exportFile plugin instance
const exportPlugin = hot.getPlugin('exportFile');
// export as a string
exportPlugin.exportAsString('csv');
// export as a blob object
exportPlugin.exportAsBlob('csv');
// export to downloadable file (named: MyFile.csv)
exportPlugin.downloadFile('csv', {filename: 'MyFile'});
// export as a string (with specified data range):
exportPlugin.exportAsString('csv', {
exportHiddenRows: true, // default false
exportHiddenColumns: true, // default false
columnHeaders: true, // default false
rowHeaders: true, // default false
columnDelimiter: ';', // default ','
range: [1, 1, 6, 6] // [startRow, endRow, startColumn, endColumn]
});
const container = document.getEleme