Created
October 28, 2016 15:11
-
-
Save AllenFang/aae34cc1dd4dd341fbbe15d99cc3bcdf 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 ActiveFormatter extends React.Component { | |
| render() { | |
| return ( | |
| <input type='checkbox' checked={ this.props.active }/> | |
| ); | |
| } | |
| } | |
| function activeFormatter(cell, row) { | |
| return ( | |
| <ActiveFormatter active={ cell } /> | |
| ); | |
| } | |
| class ReactColumnFormatTable extends React.Component { | |
| render() { | |
| return ( | |
| <BootstrapTable data={ jobs }> | |
| <TableHeaderColumn dataField='id' isKey>Job ID</TableHeaderColumn> | |
| <TableHeaderColumn dataField='name'>Job Name</TableHeaderColumn> | |
| <TableHeaderColumn dataField='active' dataFormat={ activeFormatter }>Active</TableHeaderColumn> | |
| </BootstrapTable> | |
| ); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment