Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[data grid] Row pinning with Server-side tree data #13936

Closed
atlanteh opened this issue Jul 21, 2024 · 3 comments
Closed

[data grid] Row pinning with Server-side tree data #13936

atlanteh opened this issue Jul 21, 2024 · 3 comments
Labels
component: data grid This is the name of the generic UI component, not the React module! feature: Server integration Better integration with backends, e.g. data source status: waiting for author Issue with insufficient information support: commercial Support request from paid users support: pro standard Support request from a Pro standard plan user. https://mui.com/legal/technical-support-sla/ support: question Community support but can be turned into an improvement

Comments

@atlanteh
Copy link

atlanteh commented Jul 21, 2024

The problem in depth

I might be missing something, but with the new unstable_dataSource, how do I have a totals pinned row?
For example, you have a list of sales, and you want to show the total sum of sales, the revenue etc.. as returned by the server.
In regular grid, I would get this metadata and insert it as a pinned row, but with the grid, since the data is encapsulated inside the dataSource, I'm not sure what is the best why to do that..

Your environment

No response

Search keywords: sever-side, row pinning
Order ID: 56081

@atlanteh atlanteh added status: waiting for maintainer These issues haven't been looked at yet by a maintainer support: commercial Support request from paid users labels Jul 21, 2024
@michelengelen michelengelen changed the title [question] Row pinning with Server-side tree data [data grid] Row pinning with Server-side tree data Jul 22, 2024
@michelengelen michelengelen added support: question Community support but can be turned into an improvement component: data grid This is the name of the generic UI component, not the React module! support: pro standard Support request from a Pro standard plan user. https://mui.com/legal/technical-support-sla/ labels Jul 22, 2024
@michelengelen
Copy link
Member

Hey @atlanteh the best way to do this would be to use aggregation, but as this is currently not implemented for the server-side data source feature (you can upvote and track #10860 for updates).

@MBilalShafi can we provide a workaround for this until aggregation lands?

@MBilalShafi
Copy link
Member

MBilalShafi commented Jul 24, 2024

@atlanteh Until we have an internal implementation, as a workaround, (assuming you have an endpoint that provides the aggregated value), either of these might work for you:

  1. Use colDef.renderCell to pass a custom component for the aggregation cell, where you fetch the server-side value. https://codesandbox.io/p/sandbox/mystifying-sanne-tvcsqw (Though we could export GridFooterCell or make it a slot to make such a customization easier)
  2. Use a custom aggregation function to use the server-side value stored in a state variable. https://codesandbox.io/p/sandbox/zen-sky-fgqxc9

Let me know if it helps.

@MBilalShafi MBilalShafi added status: waiting for author Issue with insufficient information and removed status: waiting for maintainer These issues haven't been looked at yet by a maintainer labels Jul 24, 2024
Copy link

The issue has been inactive for 7 days and has been automatically closed.

@oliviertassinari oliviertassinari added the feature: Server integration Better integration with backends, e.g. data source label Sep 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: data grid This is the name of the generic UI component, not the React module! feature: Server integration Better integration with backends, e.g. data source status: waiting for author Issue with insufficient information support: commercial Support request from paid users support: pro standard Support request from a Pro standard plan user. https://mui.com/legal/technical-support-sla/ support: question Community support but can be turned into an improvement
Projects
None yet
Development

No branches or pull requests

4 participants