How to capture data on cellClick?
I understand that the onRowClick function can log the data of that particular row. How do I achieve something similar for clicking on a cell? I want to know which column was clicked but onRowClick returns all the columns for that particular row.
You can access via the passed event like this:
onRowClick={(event, rowData) => {
console.log(e.target.getAttribute('value'))}} // Baran
You can access via using render in column styling
{title: 'Clients List',field: 'clientList',
render:(rowData:any)=>(
<div onClick={(e:React.MouseEvent<HTMLDivElement>)=>someMethod(e,rowData.clientList)}>{rowData.clientList}</div>)
const someMethod = (e:React.MouseEvent<HTMLDivElement>,columnData:any) => {
console.log(columnData)
}
Closing due to inactivity of @rxhl