Skip to content

Commit

Permalink
[DataGrid] Move rowGroupingModelChange handler to respective hook (m…
Browse files Browse the repository at this point in the history
  • Loading branch information
MBilalShafi authored Oct 25, 2024
1 parent 0e598b2 commit 4c6b35f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,9 @@ export const useGridRowGrouping = (
useGridApiEventHandler(apiRef, 'cellKeyDown', handleCellKeyDown);
useGridApiEventHandler(apiRef, 'columnsChange', checkGroupingColumnsModelDiff);
useGridApiEventHandler(apiRef, 'rowGroupingModelChange', checkGroupingColumnsModelDiff);
useGridApiEventHandler(apiRef, 'rowGroupingModelChange', () =>
apiRef.current.unstable_dataSource.fetchRows(),
);

/*
* EFFECTS
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,6 @@ export const useGridDataSource = (
'paginationModelChange',
runIfServerMode(props.paginationMode, fetchRows),
);
useGridApiEventHandler(apiRef, 'rowGroupingModelChange', () => fetchRows());

const isFirstRender = React.useRef(true);
React.useEffect(() => {
Expand Down

0 comments on commit 4c6b35f

Please sign in to comment.