primefaces / primefaces/primereact

Datatable ColumnGroup misses option to calculate footer values for visible rows only

Open
#2,555 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Status: Pending Review
Dominant language
CSS
Stars
8.3k
Forks
1.2k
PR merge metrics
No merged PRs in 30d

Description

I'm submitting a ... (check one with "x")

[ ] bug report
[x] feature request
[ ] support request => Please do not submit support request here, instead see https://forum.primefaces.org/viewforum.php?f=57

Current behavior
At the moment as can be seen on the examples given for Datatable ColGroup there is a fixed number calculated for the columns. The given example there doesn't make use of filtering or pagination. If I use a table with filtering or pagination the calculated sum in the ColumnGroup doesn't necessarily correspond to the rows shown, because its calculated on all rows and not only the visible ones. For the current version of PrimeReact the property 'footerColumnGroup' only accepts React.ReactNode as type. In my opinion it should be possible to also hand over a function which gets the visible rows as parameter, so the value can be calculated dependent from that.

Expected behavior
If I have a table which shows only x out of y rows, it should be possible the column sum is only calculated for the currently visible rows.

  • React version:
    17.01

  • PrimeReact version:
    7.1.0

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 Datatable ColGroup examples and the current footerColumnGroup option, then trace how filtering and pagination determine the visible rows. The work is done when footer values can be calculated from the currently visible rows while preserving existing React.ReactNode usage and behavior for unfiltered tables.

Written by the indexing model from the issue text.

Assessment

Tech stack
react
Domain
frontend
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.