-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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] Implement Row spanning #207
Comments
This comment has been minimized.
This comment has been minimized.
yes, please. such a useful feature |
This comment was marked as resolved.
This comment was marked as resolved.
(When) will this be implemented? |
Also, will this be "Pro" or "Premium" feature? |
According to our Pricing page it will be available on all plans, so open source.
We did not plan this feature yet. The Column Spanning has recently been released by the way. |
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
I would be interested to have a few examples of the use cases around row spanning |
i might have misunderstood the question, but one use case be to prevent the need for tool tip hovers such as these, which aren't accessible to keyboard users |
But in this example, there is no cell that spans across several rows. Otherwise, you are probably looking for variable row height or dynamic row height |
This comment was marked as resolved.
This comment was marked as resolved.
Any updates on this feature? Would be very useful and is a pretty common table feature |
Upvoted — I needed this feature so I searched for it, only to find out that it's a long-awaited feature that has been "coming Soon™" for over 2 years. 🥲 |
@flaviendelangle, I believe this is a use case: You guys actually have a very similar example for column spanning in your docs. |
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as off-topic.
This comment was marked as off-topic.
From a paying customer (yes, there are some of us), some insight the scheduling would be very helpful. We are running out of time and need to make a call whether to swap over to ag-grid or some such. |
I needed this feature so I searched for it, only to find out that it's a long-awaited feature that has been "coming Soon™" for over 3 years. 🥲 |
Seems like this feature is still not implemented, even for the paid plans, right? |
A quick workaround: https://codesandbox.io/p/sandbox/romantic-joji-7hhvfx?file=%2Fsrc%2FDemo.tsx%3A71%2C61 Screen.Recording.2023-11-27.at.18.34.40.movThe API looks like this: const rows = [
{
id: 1,
lastName: "Snow",
firstName: "Jon",
age: 35,
rowSpan: { age: 2 },
},
{ id: 2, lastName: "Lannister", firstName: "Cersei", age: 42 },
{ id: 3, lastName: "Lannister", firstName: "Jaime", age: 45 }, It's implemented with a function MyCell(props: GridCellProps) {
let style = {
// TODO, shouldn't be needed, fix in the core.
minWidth: props.width,
maxWidth: props.width,
minHeight: props.height,
maxHeight: props.height === "auto" ? "none" : props.height,
...props.style,
};
const apiRef = useGridApiContext();
const row = apiRef.current.getRow(props.rowId);
if (row && row.rowSpan && row.rowSpan[props.column.field]) {
const span = row.rowSpan[props.column.field];
style = {
...style,
minHeight: props.height * span,
maxHeight: props.height * span,
backgroundColor: "#fff",
zIndex: 1,
};
}
return <GridCell {...props} style={style} />;
} |
everyone give kudos to @joserodolfofreitas for getting this on the roadmap! |
for now
|
My use case for the row spanning is for 1:Many record relationships on a report. Think: Contacts < Cases < Documents So the rowspan is based on checking the table id/key and the record id, so if the previous record has the same table id and record id, then it should be combined together into one row and rowspan for all of the other columns. The real challenge is knowing the relationships between columns, and being able to have multiple tables with 1:Many relationships on the same data grid. Imagine a Contact record spans 4 rows, because they have 4 Document Records, and the Document Records are spread over 2 Cases. So, each Case would have a rowspan of 2. I’ve set this up in a custom .NET C# reporting platform, which checks the parent_table_id on each column and then the table_id and rec_id on each row. |
Regarding the behavior with filtering, we might want the same as with Excel: Screen.Recording.2024-01-11.at.02.19.49.movRows span is not just a matter of expending to the next row, but about linking two twos together. When one is filtered, no span, when sorting changes their position, likely no span as well. |
This comment was marked as resolved.
This comment was marked as resolved.
Any estimation on timeline of the feature? |
Bumping. This feature would great as we are trying to replicate a real-world form within the data grid, and it has extreme row nesting under parent call values to aggregate the children under the same group. Would anyone from the team be willing to drop some thoughts about how this would be implemented if someone from the community would like to work on a PR? @flaviendelangle @joserodolfofreitas |
@flaviendelangle @joserodolfofreitas Is there someone that I need to email or call because I pay for the premium license, and for my comment to not even so much as get a response is not acceptable. |
@jeffreyschultz, I will reach out to arrange a short user interview. We'd love to better understand your use case. @Katsuchiyo, we're wrapping up pivoting, and after that, we'll tackle Row spanning, so we're loosely talking about the possibility of releasing it next quarter (Q3 2024). |
I believe that my use case is a bit more advanced than just row spanning, but it is needed none the less. Here is an excel mockup of a current process artifact that is captured within the security field. We are attempting to convert a manual process that is captured on paper into a more automated workflow, and are attempting to replicate the original form as much as possible to ease adoption. You will notice that We also dynamically build the columns under I believe that the following is beyond the scope of row spanning, however, I am providing it for completeness to give you better insight into what we would be trying to achieve.
Can this visual design be easily achieved with what is available in the Data Grid at this time? If so, would you be able to point me to someone that could provide some advice? |
Upvoting |
@jeffreyschultz, thank you very much for sharing your use case!
We initially thought about the idea that row spanning is reflected in the data with repeated values on each row, like in the following example: But we may indeed need a way to define the hierarchy of cells to support your following described scenarios.
That's an interesting use case, unfortunately, outside the scope of the initial version, but we'll keep an eye out for a workaround (It's a tough one though).
That's also an interesting use case. We're not planning to constrain sorting like this by default, but we can likely provide a recipe using a custom comparator.
That's not supported at this time, and although Row spanning is one of the highest priorities for the next quarter, I'm afraid the initial version won't have out-of-the-box support for these most advanced use cases based on a defined hierarchy. Even the bolder borders on the created groups might be challenging. |
Yeah, that was one of my thoughts as well. It would certainly make it easier from your side to handle that. You mark which columns are to group, and then the cell renders a It seems to me that a combination of styling changes, row grouping, and row spanning could possibly get me most of the way there? The row grouping layout is different than what I am looking for, but is it possible change the rendering to something more like this? Instead of a dropdown, you get a row spanned cell? |
@jeffreyschultz, yeah, maybe you can use multiple grouping columns. Now, honestly, I think it seems close enough, but it's deceivingly hard to move from the drop-down to the row-spanning display. We'll discuss some alternatives and let you know. We can keep the discussion about this use case on #13646. |
This issue has been closed. If you have a similar problem but not exactly the same, please open a new issue. |
TODO
Clarify the scope with @joserodolfofreitasScope mentioned in https://www.notion.so/mui-org/xGrid-Row-Spanning-b178fd43907146799eb7a57d9330b68b?pvs=4#160e28c1b4b247d7befe0cbf44acd475Benchmarks
User requests
The text was updated successfully, but these errors were encountered: