ui
                                
                                
                                
                                    ui copied to clipboard
                            
                            
                            
                        Using a nested object with Datatable
When using a nested object  with the data table I get Column with id 'product.title' does not exist.
  {
    accessorKey: "product.title",
    header: "Title",
    cell: ({ row }) => (
      <div className="capitalize">{row.getValue("product.title")}</div>
    ),
  },
Should this work??
You may find the information you need in the tanstack documentation for accessorFn, which can be found here.
Example:
accessorKey: 'title', 
accessorFn: (row) => row.product.title, // return the desired value
cell: ({ row }) => (
  <div className="capitalize">{row.getValue("title")}</div>
),
                                    
                                    
                                    
                                
Thankyou!
Thanks, that worked!
This issue has been automatically closed because it received no activity for a while. If you think it was closed by accident, please leave a comment. Thank you.