TypeError happened on export CSV after js file compression
See original GitHub issueI was working on a function that export to CSV only selected rows. It went well until I tried to compress my js file. I used several plugins including gulp-minify, gulp-uglify, closure compiler and all got same error:
Uncaught TypeError: c.getSelected is not a function
at Object.c.handleExportCSV [as onExport] (default.js:956)
at onClick (default.js:981)
at Object.y (default.js:70)
at x (default.js:70)
at v (default.js:71)
at t (default.js:72)
at c (default.js:73)
at z (default.js:73)
at d (default.js:72)
at C (default.js:74)
And this is my code:
const columns = [{
dataField: 'id',
text: 'Category ID'
}, {
dataField: 'name',
text: 'Category Name'
}];
const selectRow = {
mode: 'checkbox',
clickToSelect: true
};
const { ExportCSVButton } = CSVExport;
return(
<ToolkitProvider
keyField="id"
data={ this.state.categories }
columns={ columns }
exportCSV={ {**onlyExportSelection: true**} }>
{
props => (
<div>
<ExportCSVButton { ...props.csvProps }>Export CSV!!</ExportCSVButton>
<hr />
<BootstrapTable
{ ...props.baseProps }
selectRow={ selectRow }
/>
</div>
)
}
</ToolkitProvider>
);
After it, I also tried setting ‘exportAll: false’ instead of ‘onlyExportSelection: true’. Still got an error:
Uncaught TypeError: l.getData is not a function
at l.handleExportCSV (product.bundle-min.js:1)
at onClick (product.bundle-min.js:1)
at Object.<anonymous> (product.bundle-min.js:1)
at d (product.bundle-min.js:1)
at product.bundle-min.js:1
at C (product.bundle-min.js:1)
at k (product.bundle-min.js:1)
at j (product.bundle-min.js:1)
at S (product.bundle-min.js:1)
at R (product.bundle-min.js:1)
I wonder that is there any mistake or potential name conflict error in your source code? Could you check it out? Thank you so much!
Issue Analytics
- State:
- Created 5 years ago
- Comments:12 (5 by maintainers)
Top Results From Across the Web
Javascript to csv export encoding issue - Stack Overflow
@Boltosaurus, I created a demo here: jsfiddle.net/8qPur. It looks OK to me : the downloaded file has the special characters encoded correctly. –...
Read more >Pandas to_csv() - Convert DataFrame to CSV - DigitalOcean
Pandas DataFrame to_csv() function converts DataFrame into CSV data. We can pass a file object to write the CSV data into a file....
Read more >IO tools (text, CSV, HDF5, …) — pandas 1.5.2 documentation
Return TextFileReader object for iteration. See iterating and chunking below. Quoting, compression, and file format#. compression{ ' ...
Read more >exceljs - npm
Read, manipulate and write spreadsheet data and styles to XLSX and JSON. Reverse engineered from Excel spreadsheet files as a project.
Read more >NetSuite Applications Suite - CSV Imports Overview
Editing the CustomConfiguration.js File · Optional Settings in CustomConfiguration.js ... Managing SuiteCloud Projects as Compressed Files in SuiteCloud IDE ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

Any update on this issue? Thanks!
I will look into it.