Last active
February 13, 2017 15:15
-
-
Save AllenFang/d49c17ca42f03e8349583d8c96f6968e 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 CustomPaginationPanel extends React.Component { | |
| constructor(props) { | |
| super(props); | |
| } | |
| renderPaginationPanel = (props) => { | |
| return ( | |
| <div> | |
| <div>{ props.components.pageList }</div> | |
| <div> | |
| <span>Change size per page: </span> | |
| { props.components.sizePerPageDropdown } | |
| </div> | |
| <div> | |
| <button onClick={ () => props.changeSizePerPage(25) } className='btn btn-default'>Click to force size per page as 25</button> | |
| <button onClick={ () => props.toggleDropDown() } className='btn btn-default'>Click to force toggle dropdown</button> | |
| <button onClick={ () => props.changePage(3) } className='btn btn-default'>Jump to page 3</button> | |
| </div> | |
| </div> | |
| ); | |
| } | |
| render() { | |
| const options = { | |
| paginationPanel: this.renderPaginationPanel | |
| }; | |
| return ( | |
| <div> | |
| <BootstrapTable | |
| data={ products } | |
| options={ options } | |
| pagination> | |
| <TableHeaderColumn dataField='id' isKey>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