Skip to content

Instantly share code, notes, and snippets.

@AllenFang
Created November 14, 2016 15:54
Show Gist options
  • Select an option

  • Save AllenFang/b109186f62dcb728693d00b5dc2d60e9 to your computer and use it in GitHub Desktop.

Select an option

Save AllenFang/b109186f62dcb728693d00b5dc2d60e9 to your computer and use it in GitHub Desktop.
class FullyCustomClearButtonTable extends React.Component {
createCustomClearButton = (onClick) => {
return (
<button className='btn btn-warning' onClick={ onClick }>Clean</button>
);
}
render() {
const options = {
clearSearch: true,
clearSearchBtn: this.createCustomClearButton
};
return (
<BootstrapTable data={ products } options={ options } search>
<TableHeaderColumn dataField='id' isKey={ true }>Product ID</TableHeaderColumn>
<TableHeaderColumn dataField='name'>Product Name</TableHeaderColumn>
<TableHeaderColumn dataField='price'>Product Price</TableHeaderColumn>
</BootstrapTable>
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment