Skip to content

[docs] Add recipe for reading grid state from event callbacks#22973

Open
michelengelen wants to merge 3 commits into
mui:masterfrom
michelengelen:recipe/datagrid/20808
Open

[docs] Add recipe for reading grid state from event callbacks#22973
michelengelen wants to merge 3 commits into
mui:masterfrom
michelengelen:recipe/datagrid/20808

Conversation

@michelengelen

Copy link
Copy Markdown
Member

Adds a demo showing that details.api in callbacks like onRowSelectionModelChange and onFilterModelChange is the same object as apiRef.current, and can be wrapped as { current: details.api } to pass it directly to any state selector without needing a separate useGridApiRef.

Resolves #20808

…allback

Signed-off-by: michel <jsnerdic@gmail.com>
Signed-off-by: michel <jsnerdic@gmail.com>
@michelengelen michelengelen self-assigned this Jun 26, 2026
@michelengelen michelengelen added docs Improvements or additions to the documentation. scope: data grid Changes related to the data grid. type: enhancement It’s an improvement, but we can’t make up our mind whether it's a bug fix or a new feature. labels Jun 26, 2026
@code-infra-dashboard

code-infra-dashboard Bot commented Jun 26, 2026

Copy link
Copy Markdown

Deploy preview

Bundle size

Bundle Parsed size Gzip size
@mui/x-data-grid 0B(0.00%) 0B(0.00%)
@mui/x-data-grid-pro 0B(0.00%) 0B(0.00%)
@mui/x-data-grid-premium 0B(0.00%) 0B(0.00%)
@mui/x-charts 0B(0.00%) 0B(0.00%)
@mui/x-charts-pro 0B(0.00%) 0B(0.00%)
@mui/x-charts-premium 0B(0.00%) 0B(0.00%)
@mui/x-date-pickers 0B(0.00%) 0B(0.00%)
@mui/x-date-pickers-pro 0B(0.00%) 0B(0.00%)
@mui/x-tree-view 0B(0.00%) 0B(0.00%)
@mui/x-tree-view-pro 0B(0.00%) 0B(0.00%)
@mui/x-license 0B(0.00%) 0B(0.00%)

Details of bundle changes


Check out the code infra dashboard for more information about this PR.

Signed-off-by: michel <jsnerdic@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Improvements or additions to the documentation. scope: data grid Changes related to the data grid. type: enhancement It’s an improvement, but we can’t make up our mind whether it's a bug fix or a new feature.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[docs][data grid] Accessing row selection from inside another callback (selection state is not managed)

1 participant