mirror of
https://github.com/gosticks/react-bootstrap-table2.git
synced 2025-10-16 11:55:39 +00:00
Added Prop to csv/exporter.js to allow overriding of the Blob's default type (#958)
This commit is contained in:
parent
4ec02b294a
commit
1cd31dc54c
@ -185,6 +185,9 @@ Default is `false`. Give true to avoid to attach the csv header.
|
||||
#### noAutoBOM - [bool]
|
||||
Default is `true`.
|
||||
|
||||
#### blobType - [string]
|
||||
Default is `text/plain;charset=utf-8`. Change to update the blob type of the exported file.
|
||||
|
||||
#### exportAll - [bool]
|
||||
Default is `true`. `false` will only export current data which display on table.
|
||||
|
||||
|
||||
@ -29,6 +29,7 @@ class ToolkitProvider extends statelessDecorator(React.Component) {
|
||||
separator: PropTypes.string,
|
||||
ignoreHeader: PropTypes.bool,
|
||||
noAutoBOM: PropTypes.bool,
|
||||
blobType: PropTypes.string,
|
||||
exportAll: PropTypes.bool,
|
||||
onlyExportFiltered: PropTypes.bool,
|
||||
onlyExportSelection: PropTypes.bool
|
||||
|
||||
@ -54,11 +54,12 @@ export const save = (
|
||||
content,
|
||||
{
|
||||
noAutoBOM,
|
||||
fileName
|
||||
fileName,
|
||||
blobType
|
||||
}
|
||||
) => {
|
||||
FileSaver.saveAs(
|
||||
new Blob([content], { type: 'text/plain;charset=utf-8' }),
|
||||
new Blob([content], { type: blobType }),
|
||||
fileName,
|
||||
noAutoBOM
|
||||
);
|
||||
|
||||
@ -5,6 +5,7 @@ const csvDefaultOptions = {
|
||||
separator: ',',
|
||||
ignoreHeader: false,
|
||||
noAutoBOM: true,
|
||||
blobType: 'text/plain;charset=utf-8',
|
||||
exportAll: true,
|
||||
onlyExportSelection: false
|
||||
};
|
||||
|
||||
Loading…
Reference in New Issue
Block a user