make table clickable
This commit is contained in:
parent
b5745a3c05
commit
191457d6c1
|
@ -72,7 +72,6 @@ export function DataTable<TData, TValue>({
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
const pathname = usePathname()
|
const pathname = usePathname()
|
||||||
const router = useRouter()
|
|
||||||
const [filterBy, setFilterBy] = useState(table.getAllColumns()[0])
|
const [filterBy, setFilterBy] = useState(table.getAllColumns()[0])
|
||||||
return (<>
|
return (<>
|
||||||
<div className="flex justify-between py-4">
|
<div className="flex justify-between py-4">
|
||||||
|
@ -169,7 +168,10 @@ export function DataTable<TData, TValue>({
|
||||||
data-state={row.getIsSelected() && "selected"}
|
data-state={row.getIsSelected() && "selected"}
|
||||||
>
|
>
|
||||||
{row.getVisibleCells().map((cell) => (
|
{row.getVisibleCells().map((cell) => (
|
||||||
<TableCell key={cell.id}>
|
<TableCell key={cell.id}
|
||||||
|
|
||||||
|
onClick={(e) => { console.log(`row: ${JSON.stringify(row.original)} cell: ${cell.id} ${JSON.stringify(e.timeStamp)}`) }}
|
||||||
|
>
|
||||||
{flexRender(cell.column.columnDef.cell, cell.getContext())}
|
{flexRender(cell.column.columnDef.cell, cell.getContext())}
|
||||||
</TableCell>
|
</TableCell>
|
||||||
))}
|
))}
|
||||||
|
|
Loading…
Reference in New Issue