How does one swap the 1 column cell in the overview page and retain the "clickableness" (link) of it?
When swapping to just a span you obviously can't click it so there is no way to get to the detail/document page anymore. I tried adding the Link component from NextJS but that is not working. The URL changes but you are not actually taken to the detail page.
It is probably important to mention I am using Payload within Next with
https://github.com/payloadcms/next-payloadimport Link from 'next/link';
const OrderedByCell = (props: Props) => {
const { cellData, rowData } = props;
return (
<Link href={`/admin/collections/orders/${rowData.id}`}>
{cellData.name} - {cellData.email}
</Link>
);
};
export default OrderedByCell;
^ shameless bump
If you only need the custom component to join
name + email
, you could instead create a virtual field that combines the values of these two fields, and then use default columns to rearrange your new field as the first column - by default, the first column will be linked to the doc
{
name: 'title',
type: 'text',
hooks: {
afterRead: [
({ data }) => {
return `${data.name} - ${data.email}`;
}
],
},
}
Star
Discord
online
Get dedicated engineering support directly from the Payload team.