Skip to content

Instantly share code, notes, and snippets.

@AllenFang
Created October 28, 2016 15:14
Show Gist options
  • Save AllenFang/b8a44f6cdc40191911f7024a7aa3964f to your computer and use it in GitHub Desktop.
Save AllenFang/b8a44f6cdc40191911f7024a7aa3964f to your computer and use it in GitHub Desktop.
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