-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
[data grid] Is there a way to update a single ColDef without triggering a re-render of every cell? #12952
Comments
Do you have a use-case that showcases a performance issue with the current behavior? We did work to avoid many re-renders, we could do more but we've optimized the important/frequent use-cases, we didn't pay much attention to this one as it's unlikely to affect the user experience much, imho. |
Hi, |
If you can provide an example that showcases a performance degradation, that would help us prioritize the issue. We have been working on performance optimization but we tend to focus on areas where the UX is noticeably affected. But yes in an ideal world the cells would not re-render when a column is changed. |
Here is a live example: link Screen.Recording.2024-05-02.at.15.21.58.mov |
I have opened the PR linked above to fix the issue, but fwiw I think you should use the DOM APIs directly rather than changing the column. Add/remove an attribute like |
@tomekpaszek: 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!
I'm customizing the grid in order to have column highlighting. The implementation seems pretty straightforward as I'm adding a custom field to the column definition (
highligted
) and updating the columns when needed. I use updateColumns to update a single column, however, that triggers a re-render of every cell.Is there a way to avoid that and only re-render the updated column?
Your environment
System:
OS: macOS 14.4.1
Binaries:
Node: 20.11.1 - ~/.nvm/versions/node/v20.11.1/bin/node
npm: 10.2.4 - ~/.nvm/versions/node/v20.11.1/bin/npm
pnpm: Not Found
Browsers:
Chrome: 124.0.6367.93
Edge: 124.0.2478.67
Safari: 17.4.1
npmPackages:
@emotion/react: ^11.11.4 => 11.11.4
@emotion/styled: ^11.11.0 => 11.11.0
@mui/base: 5.0.0-beta.26
@mui/core-downloads-tracker: 5.15.11
@mui/lab: 5.0.0-alpha.155 => 5.0.0-alpha.155
@mui/material: 5.14.20 => 5.14.20
@mui/private-theming: 5.15.14
@mui/styled-engine: 5.15.14
@mui/system: 5.15.15
@mui/types: 7.2.14
@mui/utils: 5.15.14
@mui/x-data-grid-pro: ^7.3.1 => 7.3.1
@mui/x-license: 7.2.0
@types/react: ^18.0.14 => 18.2.61
react: ^18.2.0 => 18.2.0
react-dom: ~18.2.0 => 18.2.0
typescript: ^5.0.2 => 5.3.3
Search keywords: updateColumns render
Order ID: 78765
The text was updated successfully, but these errors were encountered: