Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Table: totalRecords has no effect #17569

Open
3 of 4 tasks
qwenger opened this issue Feb 4, 2025 · 0 comments · May be fixed by #17654
Open
3 of 4 tasks

Table: totalRecords has no effect #17569

qwenger opened this issue Feb 4, 2025 · 0 comments · May be fixed by #17654
Labels
Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible

Comments

@qwenger
Copy link

qwenger commented Feb 4, 2025

Describe the bug

In a paginated table scenario where row data are first loaded on page change, the actual total number of entries might be different from the length of the value property. This seems to be what totalRecords is for.

However, it doesn't seem to have any effect: pagination is only activated if the length of value is greater than the rows attribute, regardless of totalRecords. (The documentation mentions that it "defaults to length of value when not defined", which implies that it could be set to something else.)

Pull Request Link

No response

Reason for not contributing a PR

  • Lack of time
  • Unsure how to implement the fix/feature
  • Difficulty understanding the codebase
  • Other

Other Reason

No response

Reproducer

https://stackblitz.com/edit/github-rbpxrszq?file=src%2Fapp%2Fapp.component.html

Environment

primeng with angular in node in alpine in docker in arch in wsl2 in win10. (it doesn't matter but you asked.)

Angular version

19.1.3

PrimeNG version

v19

Node version

No response

Browser(s)

No response

Steps to reproduce the behavior

Create a paginated p-table where data.length <= rows < totalRecords.
Behavior: pagination is disabled (only page 1 is active).

Expected behavior

Can move to page 2 and up to page number (totalRecords - 1)//rows + 1.

@qwenger qwenger added the Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible label Feb 4, 2025
Bock92 added a commit to Bock92/primeng that referenced this issue Feb 12, 2025
@Bock92 Bock92 linked a pull request Feb 12, 2025 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant