Last active
February 13, 2017 15:19
-
-
Save AllenFang/258cdfa92d6ce36a4d22ffd8b2aea17e 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 MySearchPanel extends React.Component { | |
| render() { | |
| return ( | |
| <div> | |
| <div className='input-group'> | |
| <span className='input-group-btn'> | |
| <button | |
| className='btn btn-primary' | |
| type='button'> | |
| CustomButton1 | |
| </button> | |
| { this.props.clearBtn } | |
| </span> | |
| </div> | |
| { this.props.searchField } | |
| </div> | |
| ); | |
| } | |
| } | |
| class CustomSearchFieldTable1 extends React.Component { | |
| renderCustomClearSearch = (onClick) => { | |
| return ( | |
| <button | |
| className='btn btn-success' | |
| onClick={ onClick }> | |
| Empty | |
| </button> | |
| ); | |
| } | |
| render() { | |
| const options = { | |
| clearSearch: true, | |
| clearSearchBtn: this.renderCustomClearSearch, | |
| searchPanel: (props) => (<MySearchPanel { ...props }/>) | |
| }; | |
| 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