Closed shoxter closed 2 months ago
You can find the recommendation in the docs: https://mui.com/x/react-data-grid/column-definition/#autogenerated-rows
There is no way to avoid the checks, otherwise those cells wouldn't be configurable.
I don't know how I couldn't find that. Thank you for your help.
:warning: This issue has been closed. If you have a similar problem but not exactly the same, please open a new issue. Now, if you have additional information related to this issue or things that could help future readers, feel free to leave a comment.
@shoxter: How did we do? Your experience with our support team matters to us. If you have a moment, please share your thoughts in this short Support Satisfaction survey.
The problem in depth
Hi MUI Support,
I'm encountering issues when using
valueGetter
,valueFormatter
, andrenderCell
functions in a DataGrid where some rows are auto-generated (e.g., aggregation rows). For example, callingrow.product.humanId
within these functions works fine for normal rows, but breaks when the row is auto-generated, as those fields may not exist.Is there a recommended approach to handle these errors without needing to add extensive checks in all column definitions to distinguish between auto-generated and normal rows?
Thanks for your help!
Your environment
`npx @mui/envinfo`
``` Don't forget to mention which browser you used. Output from `npx @mui/envinfo` goes here. ```Search keywords: Auto-generated rows Order ID: 96266