AllenFang / react-bootstrap-table

A Bootstrap table built with React.js
https://allenfang.github.io/react-bootstrap-table/
MIT License
2.23k stars 782 forks source link

How to insert a custom column content #1453

Closed johhansantana closed 7 years ago

johhansantana commented 7 years ago

I had before with a regular table this:

<td>
  <Link href={`/dashboard/reports/subastas/detail?id=${request.id}`}>
    <a
      className="btn btn-outline-primary btn-sm waves-effect"
    >
      Ver Detalles
    </a>
  </Link>
</td>

How do I add a column that has this?

johhansantana commented 7 years ago

ok got it working

static buttonAction(cell: number): Object {
  return (
    <Link href={`/dashboard/reports/subastas/detail?id=${cell}`}>
      <a
        className="btn btn-outline-primary btn-sm waves-effect"
      >
        Ver Detalles
      </a>
    </Link>
  )
}
...
<TableHeaderColumn 
  width={'180'} 
  dataField='id' 
  dataFormat={ Index.buttonAction } 
  dataAlign="center"
>
  Acciones
</TableHeaderColumn>