Open NilapuAnusha opened 6 years ago
With inline dataFormat you have access to the enclosing scope so:
col.map( name =>
<TableHeaderColumn
dataFormat={
(cell, row, formatExtraData, index) => {
name <-- you can access it
}
}
....
Have you found the answer? Please let me know if you have any solutions to this issue.
I have below code
render() { const col = [ 'id', 'name', 'price' ]; return ( <BootstrapTable data={ products } keyField={ col[0] }> { col.map(name => <TableHeaderColumn dataField={ name }>{ name }</TableHeaderColumn>) } </BootstrapTable> ); }
Now I want to add dataFormat to TableHeaderColumn. How can I acces dataField in dataFormat to know the key?