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

LastPageLink in Paginator: doesn't give "totalPages" in options #5978

Closed
riccardinhocala opened this issue Feb 15, 2024 · 4 comments · Fixed by #5982
Closed

LastPageLink in Paginator: doesn't give "totalPages" in options #5978

riccardinhocala opened this issue Feb 15, 2024 · 4 comments · Fixed by #5982
Assignees
Labels
Type: Enhancement Issue contains an enhancement related to a specific component. Additional functionality has been add
Milestone

Comments

@riccardinhocala
Copy link

Describe the bug

As can also be seen in the documentation, the PaginatorLastPageLinkOptions interface does not give totalPages data (as is the case in PaginatorCurrentPageReportOptions, for example). To compensate for this lack, it is mandatory to use a useState because there is no possibility of calculating the last page using other options, which are available in other interfaces.

Reproducer

No response

PrimeReact version

10.5.1

React version

17.x

Language

TypeScript

Build / Runtime

Next.js

Browser(s)

No response

Steps to reproduce the behavior

No response

Expected behavior

As with other Paginator components, having the totalPages in the options

@riccardinhocala riccardinhocala 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 15, 2024
@melloware melloware added Status: Needs Reproducer Issue needs a runnable reproducer and removed Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible labels Feb 15, 2024
Copy link

Please fork the Stackblitz project and create a case demonstrating your bug report. This issue will be closed if no activities in 20 days.

@melloware
Copy link
Member

I am confused as to what you are asking for so I need an example to see what you are doing and what you mean.

@riccardinhocala
Copy link
Author

Yes, of course. I'm sorry for my poor explanation.

immagine_2024-02-15_151350410
immagine_2024-02-15_151641492

As you can see in images, PaginatorLastPageLinkOptions doesn't provides "totalPages" data (as is done in PaginatorCurrentPageReportOptions, or PaginatorPageLinksOptions).

In this way I can only create a button (or span, div, ect.) with an icon or a "»" as text, and not with the specific number.

To have this situation in image below, where "10" is the last page:
image
I have to use a useState for "totalPages" and calculate it from "totalRecords / rows".

@melloware melloware added Type: Enhancement Issue contains an enhancement related to a specific component. Additional functionality has been add and removed Status: Needs Reproducer Issue needs a runnable reproducer labels Feb 15, 2024
@melloware
Copy link
Member

Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Enhancement Issue contains an enhancement related to a specific component. Additional functionality has been add
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants