I'm assuming that the admin defaultColumns are the columns displayed in the admin ui for its given collection.
If I add 'clientName' to the defaultColumn array and set useAsTitle: 'clientName', nothing seems to happen
const CaseStudies: CollectionConfig = {
slug: 'case-studies',
admin: {
defaultColumns: ['clientName', 'author', 'category', 'status'],
useAsTitle: 'clientName',
},
access: {
read: () => true,
},
fields: [
{
name: 'clientName',
type: 'text'
},
{
name: 'clientWebsite',
type: 'text'
},
My admin UI only displays the author, category and status column as can be seen in the screenshot. No clientName.
What am I doing wrong?
Have you previously selected columns to show using the column filter pill button?
When you do that it saves your preferences in the DB. You can clear your preferences or log in with a new user to see them in the new order. There has been a little bit of chatter on github discussions. Some people have proposed adding a button that allows you to reset to display default columns. But as of right now you would need to clear the user preference in the DB or manually add the new column using the filters pill button.
Adding the new column via the filters button worked. Thanks 👍
Star
Discord
online
Get help straight from the Payload team with an Enterprise License.