Created
October 28, 2016 15:14
-
-
Save AllenFang/b8a44f6cdc40191911f7024a7aa3964f 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, enumObject, index) { | |
console.log(`The row index: ${index}`); | |
return ( | |
<ActiveFormatter active={ cell } /> | |
); | |
} | |
class GetRowIndexTable 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