react-bootstrap-table2/docs/export-csv-props.md
2019-03-17 16:42:59 +08:00

1.5 KiB

id title
export-csv-props Export CSV Props

Export CSV in one of features supported by react-bootstrap-table2-toolkit. By passing exportCSV prop to ToolkitProvider for enabling this functionality.

Required

N/A

Optional

Example

<ToolkitProvider
  keyField="id"
  data={ products }
  columns={ columns }
  exportCSV={ {
    fileName: 'custom.csv',
    separator: '|',
    ignoreHeader: true,
    noAutoBOM: false
  } }
>
  //...
</ToolkitProvider>

exportCSV.fileName - [Bool]

Custom the csv file name.

exportCSV.separator - [String]

Custom the csv file separator.

exportCSV.ignoreHeader - [bool]

Default is false. Give true to avoid to attach the csv header.

exportCSV.noAutoBOM - [bool]

Default is true.

exportCSV.exportAll - [bool]

Default is true. false will only export current display data on table.

exportCSV.onlyExportSelection - [bool]

Default is false. true will only export the data which is selected

exportCSV.onlyExportFiltered - [bool]

Default is false. true will only export the data which is filtered/searched.

Note: When you configure this prop as true, you must turn off exportAll.