Search This Blog

MUI DataGrid Column for nested object

const data = [ 
               { company: 'AAA', contact: { name: 'John Doe', email: 'john.doe@aaa.com } },
               { company: 'BBB', contact: { name: 'Mike Boh', email: 'mike.boh@bbb.com } }
             ];


const columnDefns=[
            {
                field: 'company',
                headerName: 'Company',
            },
            {
                field: 'contact',
                headerName: 'Contact',
                valueFormatter: (params) => params.contact.name
            }
            ];



see also

No comments:

Post a Comment