Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

react-data-table-component cell action

const columns =  [
  {
    cell:(row) => <button onClick={this.clickHandler} id={row.ID}>Action</button>,
    ignoreRowClick: true,
    allowOverflow: true,
    button: true,
  },
  {
    name: 'ID',
    selector: 'ID',
    sortable: true,
    grow: 2,
  },
  {
    name: 'Name',
    selector: 'name',
    sortable: true,
    grow: 2,
  }
  ]
  
   clickHandler = (state) => {
    debugger;
    console.log(state.target.id);
  };
 
PREVIOUS NEXT
Tagged: #cell #action
ADD COMMENT
Topic
Name
7+2 =