Skip to content

Conversation

arminmeh
Copy link
Contributor

@arminmeh arminmeh commented Sep 15, 2025

@arminmeh arminmeh added scope: data grid Changes related to the data grid. type: new feature Expand the scope of the product to solve a new problem. plan: Premium Impact at least one Premium user. feature: Server integration Better integration with backends, e.g. data source feature: Pivoting Related to the data grid pivoting feature labels Sep 15, 2025
@mui-bot
Copy link

mui-bot commented Sep 15, 2025

Deploy preview: https://deploy-preview-19575--material-ui-x.netlify.app/

Updated pages:

Bundle size report

Bundle Parsed size Gzip size
@mui/x-data-grid 🔺+36B(+0.01%) ▼-2B(0.00%)
@mui/x-data-grid-pro 🔺+154B(+0.03%) 🔺+54B(+0.04%)
@mui/x-data-grid-premium 🔺+3.93KB(+0.62%) 🔺+1.36KB(+0.72%)
@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%)

Details of bundle changes

Generated by 🚫 dangerJS against f4151e0

Copy link
Contributor

@mapache-salvaje mapache-salvaje left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

docs review here - nicely done!

@arminmeh arminmeh force-pushed the server-side-pivoting branch from 1610c4a to da5751d Compare September 22, 2025 07:43
@github-actions github-actions bot added the PR: out-of-date The pull request has merge conflicts and can't be merged. label Sep 22, 2025
Copy link

This pull request has conflicts, please resolve those before we can evaluate the pull request.

@arminmeh arminmeh force-pushed the server-side-pivoting branch from da5751d to 3f7ed42 Compare September 22, 2025 08:51
@github-actions github-actions bot removed the PR: out-of-date The pull request has merge conflicts and can't be merged. label Sep 22, 2025
@arminmeh arminmeh force-pushed the server-side-pivoting branch from db48ab0 to d51883d Compare September 29, 2025 14:39
@arminmeh arminmeh force-pushed the server-side-pivoting branch from d51883d to 0ad8eec Compare September 30, 2025 09:41
@zannager zannager changed the title [DataGridPremium] Server-side pivoting [data grid] Server-side pivoting Sep 30, 2025
@arminmeh arminmeh changed the title [data grid] Server-side pivoting [DataGridPremium] Server-side pivoting Sep 30, 2025
@arminmeh arminmeh force-pushed the server-side-pivoting branch from be0641c to 6f9eb96 Compare October 3, 2025 15:08
@arminmeh arminmeh requested a review from alelthomas October 7, 2025 08:07
Copy link
Contributor

@alelthomas alelthomas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tiny tweaks—looking great!

Copy link
Member

@MBilalShafi MBilalShafi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work 👏

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In this demo, adding anything to values in pivoting section breaks it as there are no default aggregation functions:

Screen.Recording.2025-10-07.at.17.44.45.mov

Should we disable pivoting configuration panel with data source unless the required props for pivoting to work are provided?

Or at least improve the error message a bit:

diff --git a/packages/x-data-grid-premium/src/components/pivotPanel/GridPivotPanelField.tsx b/packages/x-data-grid-premium/src/components/pivotPanel/GridPivotPanelField.tsx
index d0ed78ba3..76f60f721 100644
--- a/packages/x-data-grid-premium/src/components/pivotPanel/GridPivotPanelField.tsx
+++ b/packages/x-data-grid-premium/src/components/pivotPanel/GridPivotPanelField.tsx
@@ -183,6 +183,12 @@ function AggregationSelect({
     setAggregationMenuOpen(false);
   };
 
+  if (!aggFunc) {
+    throw new Error(
+      `Aggregation function \`${aggFunc}\` not found, please provide a valid aggregation function`,
+    );
+  }
+
   return (
     <React.Fragment>
       <rootProps.slots.baseChip

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think that there should be an error, probably just hide it and warn about this on the pivoting page
We do the same for the aggregations dropdown in the column menu.
"Manage pivoting" should also be hidden.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This can also happen without a data source if you override the default with an empty array.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have fixed the panel from crashing.
I am thinking now, since this kind of error also occurs on other premium demos with the data source
For example
https://mui.com/x/react-data-grid/server-side-data/aggregation/
The first demo here crashes if you try to group rows, because the input params are not read correctly, and the data source is not configured for that scenario.

Instead of us covering all these cases, is it better to show demos with disabled features or data sources supporting the feature so that the user can decide what they want to implement?
Automatically hiding UI elements might be confusing for the users, and we may still miss some use cases (present or in the future).

@mui/xgrid should I create another docs issue to check all demos and adjust where necessary?

Copy link
Contributor Author

@arminmeh arminmeh Oct 8, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Created #19849 to cover other cases
Implemented the same for the demos that were part of this PR in 0cf8fc3 (#19575)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will merge the PR with these changes to have it ready for the release.
If needed, this can be changed in a different PR, since it is not an issue that originated with this feature.

@arminmeh arminmeh merged commit 2c0bc1a into mui:master Oct 8, 2025
21 checks passed
@arminmeh arminmeh deleted the server-side-pivoting branch October 8, 2025 21:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature: Pivoting Related to the data grid pivoting feature feature: Server integration Better integration with backends, e.g. data source plan: Premium Impact at least one Premium user. scope: data grid Changes related to the data grid. type: new feature Expand the scope of the product to solve a new problem.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[data grid] Implement server-side data source with pivoting

6 participants