Reputation: 183
onMeetingTitleClick is working when i use onClick but it only works for that specific column.
I'm trying to get it working for the entire row using onRowClicked but i don t think i'm doing it right. Any ideas?
const MeetingsTable = ({ meetings, onMeetingTitleClick }) => {
...
const columns = [
{
name: 'Title',
cell: row => (
<div data-tag="allowRowEvents">
<div aria-hidden="true" onClick={e => onMeetingTitleClick(e, row.id)}>
{row.name}
</div>
</div>
),
},
];
const onRowClicked = () => (result.map(result => (e => onMeetingTitleClick(e, result.id))));
return (
<DataTable
columns={columns}
data={result}
onRowClicked={onRowClicked}
/>
);
... Omitted other values
Reference lib: https://github.com/jbetancur/react-data-table-component
Upvotes: 3
Views: 5689
Reputation: 183
Managed to complete this by using the following
const onRowClicked = (row, event) => { onMeetingTitleClick(event, row.id); };
https://github.com/jbetancur/react-data-table-component#readme
Upvotes: 3