Closed abhiram5 closed 5 years ago
@abhiram5
use dataFormat
prop for TableHeaderColumn
<TableHeaderColumn dataField="name" dataFormat={this.nameFormat} >Name</TableHeaderColumn>
and method
...
import { Link } from 'react-router-dom'
...
class ... {
...
nameFormat(cell, row) {
const id = `/edit/${row.name}`
return (
<Link to={id}> {cell} </Link>
);
}
...
};
Data is coming from the backend in the form js object
rows: [ { 'name': 'Wing', 'email': 'tellus.eu.augue@arcu.com', 'regDate': '2016-01-09T14:48:34-08:00', 'city': 'Paglieta', 'age': 25 }, { 'name': 'Whitney', 'email': 'sed.dictum@Donec.org', 'regDate': '2017-01-23T20:09:52-08:00', 'city': 'Bear', 'age': 32 } ]