primefaces / primefaces/primereact
DataTable: Subheader row group with sorting
Nobody has claimed this yet.
- Dominant language
- CSS
- Stars
- 8.3k
- Forks
- 1.2k
- PR merge metrics
- No merged PRs in 30d
Description
Describe the bug
Subheader row group works wrong when you apply grouping on DataTable wihout sorting, or with sorting by different field than group field. If rows with same values go exactly one after another before applying grouping, they they will be grouped together, but if they are separated by rows with different value, they will be grouped to different groups.
I took the grouping stackblitz example from the documentation and change sortField to "status" in it. As you can see, the group by name has split into several groups.
Reproducer
https://stackblitz.com/edit/uqllcb-jazz5i?file=src%2FApp.jsx
PrimeReact version
latest
React version
18.x
Language
TypeScript
Build / Runtime
Vite
Browser(s)
No response
Steps to reproduce the behavior
- Take DataTable without sorting, or with sorting by one field;
- Apply subheader row group to DataTable with another field;
Expected behavior
Rows are grouped with the groupRowsBy property regardless of sorting in the table
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the linked StackBlitz reproducer and inspect the DataTable subheader row-grouping entry point used by the example. Reproduce the split groups with no sorting or sorting by a different field, then verify that rows sharing groupRowsBy are rendered in one group regardless of the table's sort field.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- react, typescript, vite
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100