-
Notifications
You must be signed in to change notification settings - Fork 775
How can I export the table with the selected rows #567
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
The attributes REMOTE must be true, then the table can be exported with the selected rows...means you must handle the data filtering, sorting, adding or removing etc on your own. |
You need to return the rows in I write a example without testing, maybe you can try it class ExportCSVTable extends React.Component {
onExportToCSV = () => {
const selectedRows = this.refs.table.state.selectedRowKeys;
return products.filter(prod => {
if (selectedRows.indexOf(prod.id) > -1) {
return prod;
}
});
}
render() {
const selectRow = {
mode: 'checkbox'
};
const options = {
onExportToCSV: this.onExportToCSV
};
return (
<BootstrapTable ref='table' data={ products } exportCSV={ true } options={ options } selectRow={ selectRow }>
<TableHeaderColumn dataField='id' isKey={ true }>Product ID</TableHeaderColumn>
<TableHeaderColumn dataField='name'>Product Name</TableHeaderColumn>
<TableHeaderColumn dataField='price'>Product Price</TableHeaderColumn>
</BootstrapTable>
);
}
} |
Sorry, I thinks the snippet is not work. BTW, you are right, I need to do some fixing for avoid |
@Basketballislife, this issue fixed on |
but what is the struct of the return value?
Thank u
The text was updated successfully, but these errors were encountered: