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

feat(paginator): add initialPage prop for page initialization #7079

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

j0rgedev
Copy link
Contributor

Defect Fixes

#7023

Resolution

Cause

The Paginator component did not have a way to initialize on a specific page.

Solution

Added a new initialPage prop to allow users to specify the page to initialize the Paginator.

Additional Notes

  • Added tests to cover the new initialPage functionality.

Copy link

vercel bot commented Jan 13, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

2 Skipped Deployments
Name Status Preview Updated (UTC)
primevue ⬜️ Ignored (Inspect) Visit Preview Jan 13, 2025 1:22am
primevue-v3 ⬜️ Ignored (Inspect) Visit Preview Jan 13, 2025 1:22am

@tugcekucukoglu
Copy link
Member

tugcekucukoglu commented Jan 13, 2025

What about first property? What is the difference between initialPage and first?

@tugcekucukoglu tugcekucukoglu added the Resolution: Needs Revision The pull request can't be merged. Conflicts need to be corrected or documentation and code updated. label Jan 13, 2025
@j0rgedev
Copy link
Contributor Author

Hello @tugcekucukoglu, I just reviewed this in more detail, and it seems that first has a slightly different purpose. While it’s true that if you set :first="11" (with 10 rows per page), it automatically moves to the second page, the first prop also works in cases like :first="2", where it only shows rows starting from the third one (skipping the first two). This aligns with its description: "Zero-relative number of the first row to be displayed."

On the other hand, the new initialPage prop I introduced is specifically designed to set the initial page of the paginator without affecting the rows or their offsets. It’s a more targeted way of initializing the paginator to a specific page.

So, while both props may overlap in functionality, their use cases are different. I believe this justifies the new prop, but I’d be happy to hear your feedback if you think it’s unnecessary or could be improved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Resolution: Needs Revision The pull request can't be merged. Conflicts need to be corrected or documentation and code updated.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants