Last active
February 13, 2017 15:17
-
-
Save AllenFang/d313a63737ee691b7f5cdc1a1505e270 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class CustomSizePerPageDropDown extends React.Component { | |
| constructor(props) { | |
| super(props); | |
| } | |
| onToggleDropDown = (toggleDropDown) => { | |
| // do your stuff here | |
| console.log('toggle dropdown'); | |
| toggleDropDown(); | |
| } | |
| renderSizePerPageDropDown = (props) => { | |
| return ( | |
| <SizePerPageDropDown | |
| className='my-size-per-page' | |
| btnContextual='btn-warning' | |
| variation='dropup' | |
| onClick={ () => this.onToggleDropDown(props.toggleDropDown) }/> | |
| ); | |
| } | |
| render() { | |
| const options = { | |
| sizePerPageDropDown: this.renderSizePerPageDropDown | |
| }; | |
| return ( | |
| <div> | |
| <BootstrapTable | |
| data={ products } | |
| options={ options } | |
| pagination> | |
| <TableHeaderColumn dataField='id' isKey={ true }>Product ID</TableHeaderColumn> | |
| <TableHeaderColumn dataField='name'>Product Name</TableHeaderColumn> | |
| <TableHeaderColumn dataField='price'>Product Price</TableHeaderColumn> | |
| </BootstrapTable> | |
| </div> | |
| ); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment