primefaces / primefaces/primereact

DataTable: Subheader row group with sorting

Open
#6,768 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Status: Needs Triage
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.

Без имени-3

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
  1. Take DataTable without sorting, or with sorting by one field;
  2. 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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.