Nov 23, 2021
A big thanks to the 3 contributors who made this release possible. Here are some highlights ✨:
-
🎁 New API to validate the editing values (#3006) @m4theushw
You can now use the
preProcessEditCellProps
key inGridColDef
to synchronously or asynchronously validate the values committed.const columns: GridColDef[] = [ { field: 'firstName', preProcessEditCellProps: (params: GridEditCellPropsChangeParams) => { const hasError = params.props.value.length < 3; return { ...params.props, error: hasError }; }, }, { field: 'email', preProcessEditCellProps: async (params: GridEditCellPropsChangeParams) => { const userWithEmail = await fetchUserByEmail(params.value); const hasError = !!userWithEmail; return { ...params.props, error: hasError }; } } ];
-
✨ New method
getRootDimensions
to access the size of the grid (#3007) @flaviendelangleIt contains the size of the viewport (which is the scrollable container containing the rows and columns) considering scrollbars or not.
const dimensions = apiRef.current.getRootDimensions();
@mui/x-data-grid@v5.0.1
/ @mui/x-data-grid-pro@v5.0.1
Changes
- [DataGrid] New API to validate the editing values (#3006) @m4theushw
- [DataGrid] Use color-scheme to set dark mode on native components (#3146) @alexfauquette
- [DataGrid] Fix the
@mui/x-data-grid
type entrypoint (#3196) @flaviendelangle
Core
- [core] Drop
useGridContainerProps
(#3007) @flaviendelangle - [core] Move
getRowIdFromRowIndex
andgetRowIndex
to the sorting API (#3126) @flaviendelangle - [core] Polish v5 CHANGELOG (#3194) @oliviertassinari
- [core] Remove the
index.ts
of the export hooks (#3165) @flaviendelangle - [core] Set the correct release date for v5.0.0 in the CHANGELOG.md (#3192) @flaviendelangle
Docs
- [docs] Move sentence about disabling multi rows selection (#3167) @alexfauquette