'Is there any option available in DataGrid MUI to export columns with renderCell on a complex object?
I am exporting DataGrid @mui/x-data-grid table using CustomToolbar
I have one of the columns as below
{
field: 'industry_type',
headerName: 'Industry',
renderCell: (params) => {
const industry = params.row.industry_type;
return (
<>
<p>{`${industry.code}- ${industry.value}`} </p>
</>
);
}
}
The csv file downloaded from export option gives the value as [object Object]
How do I get the actual value in csv downloaded file? I need help in fixing this. Thanks.
Solution 1:[1]
Does valueGetter work for exports?
{
field: 'industry_type',
headerName: 'Industry',
renderCell: (params) => {
const industry = params.row.industry_type;
return (
<>
<p>{`${industry.code}- ${industry.value}`} </p>
</>
);
},
valueGetter: (params) => `${params.row.industry_type.code}- ${params.row.industry_type.value}`,
}
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | coot3 |
