Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

table sort deeper accessorKey with accessorFn? #3677

Open
schillerenrico opened this issue Mar 25, 2025 · 1 comment
Open

table sort deeper accessorKey with accessorFn? #3677

schillerenrico opened this issue Mar 25, 2025 · 1 comment
Labels
question Further information is requested v3 #1289

Comments

@schillerenrico
Copy link

Description

Hi, I just wanted to sort a column of uTable. The problem is the accessorKey looks like this "type.name" and it looks like tanstack isnt sorting deeper keys. So how can I approach this problem and it would be very helpful to have an example of it in the uTable documentation.
Thanks!

@schillerenrico schillerenrico added question Further information is requested v3 #1289 labels Mar 25, 2025
@dSlyders
Copy link

dSlyders commented Mar 29, 2025

you can use accessorFn for me its work

<UTable ref="table"  :data="data" :columns="columns" />
 const columns = [
    {
      accessorFn: (row) => {
        return  `${row?.name ?? ''} ${row?.email ?? ''}`.trim() ;
      },
      cell: ({ row }) => {
        return  h('div', undefined, [h('p', { class: 'text-md' }, row.original.name+' '+row.original.email)]),
      },
    },
]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested v3 #1289
Projects
None yet
Development

No branches or pull requests

2 participants