[rh-table] Expandable pattern #1565
Replies: 3 comments 3 replies
-
If a parent row is expanded wouldn't we want the child content (expanded info) to represent that expanded relationship? I feel like just hiding and showing an additional row doesn't maintain why you'd want to "expand" the current row selection to begin with. I definitely understand and respect the technical hurdles with trying to maintain the standard slotted html table though. I'm not sure in the current iteration of |
Beta Was this translation helpful? Give feedback.
-
Big +1 to Steven on this:
The key question for me is what constitutes "additional content" in the OP. If we're basically hiding rows/entries of tabular data (where the entries have the same structure, but one or more cell values may change), I think Adam had a great idea to investigate the treegrid (especially if multiple columns will be affected, like in the WAI treegrid example). I admit, I haven't built one, either. But if we're just revealing content for existing entries, seems to me that a new row isn't appropriate. It's not a new data entry. We wouldn't put it as a new row in a spreadsheet. Judging by the CodePen example at least, the initially-hidden info represents either:
If it's the former, instead of adding any new rows, you could maybe consider just putting that new content in a disclosure widget in the relevant "Event" cell. (Or adding some other way to reveal the new info: making the "Event" cell value a link to another page, making that same text a button that pops up additional info on click, or something. Just spitballing.) If the latter, then we're talking about hiding columns by default, and then letting them be expandable somehow. I always get a little nervous about building tables that could wind up any more complicated than they need to be (and that includes the potential solutions I mentioned). I guess I'd want to see an example of the info we want to hide/show before stating anything conclusive. |
Beta Was this translation helpful? Give feedback.
-
Sorry for the delay in the responses here
For us it's because the data that we have coming back can include many items that can have the same name but be functionally independent. From the frontend perspective, we're consolidating those items into one row so instead of hundreds of rows saying the same name but with different subdata we show them one overarching row with the general data displayed which we would then give more granularly when we expand the table row. @hellogreg We want to display an extension of the text in the row that is being extended not necessarily a new column of data. I like the suggestion of perhaps using a disclosure element to solve this. I'll add this suggestion to our jira board. Thank you all so much! |
Beta Was this translation helpful? Give feedback.
-
https://codepen.io/OhHeyBrian/pen/abrbLXK
Very basic demo that would add functionality to a table row where if you click the row it expands and shows additional content. Needs additional detail and work done to it but wanted to get some feedback on what you all thought of this as a pattern.
We were initially considering using patternfly elements pf-table component but given how different the markup was I went in and wanted to see how difficult it would be to add it through JavaScript.
Beta Was this translation helpful? Give feedback.
All reactions