Comments (4)
@aress31 Thank you for using MUI X Data Grid and providing useful feedback. 😊
The request you made makes sense and is already made previously in #5647
Fortunately it's already in our backlog and should be prioritized as some bandwidth is available.
Please feel free to checkout the discussion or hop in with your feedback on the mentioned ticket.
I'll close this one just to keep all the conversation on the same place.
Thank you.
from mui-x.
I would suggest that you keep listening to the state changes but only trigger your logic when specific parts of it change. This is flexible enough to cover all use cases, and is exactly what we do inside the grid to trigger targetted re-renders.
// Select the parts of the state you care about
// NOTE: make sure to use the public selectors from the docs, the state's inner structure isn't public
const selector = state => [state.a, state.b, state.c]
const cachedValues = useRef([])
useEffect(() => {
return apiRef.current.subscribeEvent('stateChange', state => {
const values = selector(state)
if (!values.every((v, i) => v === cachedValues.current[i])) {
// [insert save state code here]
cachedValues.current = values
}
})
}, [])
I don't like the idea of adding a prop for this specifically, it's too specific and doesn't have a significant advantage over using the implementation above. Does that solve your issue?
from mui-x.
From an ease of use and DX
perspective I would still prefer the onDensityChange
handler to remain consistent with all the other handlers.
from mui-x.
@mui/xgrid Any other opinions on adding a prop here?
from mui-x.
Related Issues (20)
- [question] Am I able to provide multiple rules to the initialState sortModel for DataGridPro HOT 3
- DataGridPremium edit mode aggregate total not working
- [TimeClock] The value does not update when ending the drag outside of the clock container HOT 1
- [DataGrid] row's popup appears even when the row itself doesn't HOT 1
- [TreeView] If not all nodeId`s are different opening an item crashes the browser HOT 1
- [question] Deep Filtering in Master-Detail Data Grid using Main Toolbar HOT 8
- DatePicker and DateRangePicker don't always display value passed HOT 1
- [datagrid] Row grouping object field values HOT 7
- Datagrid Pro Y-axis dimension keeps changing when apply 'styled' HOT 2
- [pickers] "@mui/x-date-pickers" leads to build break on Node.js v21.0.0 HOT 10
- Replacement of the disableMaskedInput prop in DatePicker v6 HOT 17
- [DataGridPro] How to enable filtering up to seconds for datetime columns? HOT 3
- Datagrid filter deletion does not always delete the filter value
- Datagrid toolbar inconsistent default icon size HOT 1
- [datagrid] v7 API: update `GridColDef` methods signatures HOT 8
- [question] Is there a more well-supported way to modify the tree data grouping column cell content? HOT 2
- [datagrid] Average aggregation treats `undefined`/`null` values as zeros
- [datagrid] Size aggregation counts `undefined` values
- [DataGrid] graphic glitch when we change to next page with getRowHeight 'auto' HOT 1
- [pickers] referenceDate not working as expected HOT 12
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mui-x.