Feature Request: Native row grouping support for QTable #18510
Unanswered
davidyarkan
asked this question in
Ideas / Proposals
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Problem
QTablecurrently supports sorting, filtering, pagination, virtual scrolling, custom body slots, etc., but there is no native mechanism for grouping rows by one or more fields.Grouping currently requires preprocessing the dataset and/or manually injecting group rows through slots. This makes common use cases such as hierarchical data presentation, subtotals, and collapsible groups unnecessarily complex.
Proposed Feature
Add native row grouping support to
QTable, similar to thegroupByfunctionality available in other table libraries such as Vue Good Table.For example:
Given:
The table would internally group the rows:
Suggested API
Basic grouping
Multiple grouping levels
Resulting hierarchy:
Group configuration
A configuration object could provide additional behavior:
Or alternatively:
Group slots
There should be a dedicated slot for rendering a group header:
The slot scope could expose information such as:
This would allow applications to implement custom group headers, icons, counters, totals, etc.
Group-level aggregation
It would also be useful to expose group rows to the existing aggregation mechanisms.
For example:
Potentially:
with access to:
Interaction with existing QTable features
Grouping should ideally integrate with existing
QTablefunctionality:The important point is that grouping should be part of the table's row model rather than requiring users to modify the original
rowsarray by inserting artificial group rows.State management
For expandable groups, the expanded state could be controlled similarly to row expansion:
For example:
Ideally, group keys should be generated deterministically, especially when using multiple grouping levels.
Why native support is useful
Without native grouping, implementing this generally requires:
This becomes particularly difficult when several
QTablefeatures are used simultaneously.A native implementation could keep grouping as part of the table's internal row-processing pipeline:
rather than requiring applications to emulate grouping at the data level.
Expected behavior
Grouping should not modify the original
rowssupplied by the user.For example:
should remain:
The grouping should be a presentation/data-processing concern handled internally by
QTable.References
A similar concept is implemented by Vue Good Table through row grouping. The goal is not necessarily to reproduce its API, but to provide equivalent functionality following Quasar's existing API conventions.
This would be particularly valuable for applications that need to represent hierarchical or categorized datasets while retaining the existing
QTablefeatures.All reactions