React-table: How to add button in each row?

Created on 22 Apr 2017  路  3Comments  路  Source: tannerlinsley/react-table

give me some sample codes to add button in a row.

Most helpful comment

you do it via render... its in the docs on the front page under the section titled custom-cell-header-and-footer-rendering.

const columns = [{
  header: '',
  id: 'click-me-button',
  render: ({ row }) => (<button onClick={(e) => this.handleButtonClick(e, row)}>Click Me</button>)
}];

All 3 comments

you do it via render... its in the docs on the front page under the section titled custom-cell-header-and-footer-rendering.

const columns = [{
  header: '',
  id: 'click-me-button',
  render: ({ row }) => (<button onClick={(e) => this.handleButtonClick(e, row)}>Click Me</button>)
}];

Below is an updated way to do this via Cell property

https://react-table.js.org/#/story/cell-renderers-custom-components

Hey guys, I want to add a Button to delete a record, How can I do this ? I need to pass the item Id to a function.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

missmellyg85 picture missmellyg85  路  3Comments

monarajhans picture monarajhans  路  3Comments

danielmariz picture danielmariz  路  3Comments

krishna-shenll picture krishna-shenll  路  3Comments

DaveyEdwards picture DaveyEdwards  路  3Comments