-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
DataTable Wrong highlighting on pagination dropdown #5795
Comments
This comment was marked as resolved.
This comment was marked as resolved.
Sure, here is a Minimal Example: CodeSandbox |
@ncavallini i see now. It is because you are not using the table correctly. You are trying to control the paging yourself while swapping out the table underneath. That is not the correct what to "page using an API". That example is here using the Lazy example: https://primereact.org/datatable/#lazy_load That is the proper way to "page" with an API. |
@melloware I checked the example you mentioned on the website, but this doesn't work either, because (at least in TypeScript) there are some errors when running it i.e., in Stackblitz. For example: |
@ncavallini the TypeScript examples are not currently fully working see : #5800 But I have a fully working Lazy example with REST Service in TypesScript: https://github.com/melloware/quarkus-primereact If you want to look at the actual code its here: https://github.com/melloware/quarkus-primereact/blob/main/src/main/webui/src/CrudPage.tsx Its 100% typescript and Sorts, Paging, Filtering, all work lazy |
This looks great, thanks! Sorry for not knowing about #5800 :) |
if you are a Java guy you can literally run the entire project with 1 command |
Well, I am, and I was digging right into it |
You will fall in love with Quarkus if you have never used it.... |
Describe the bug
Hi all,
I've implemented a DataTable with server-side pagination (lazy loading) successfully. There's a little UI bug though (which I may have introduced myself) that the "current page" highlighting at the bottom (the blue square) is stuck at Page 1, and does not update. This also reflects on the fact that when I click
>>
or<<
the numbers do not increase (they rimain 1..5).Here's my code:
pageable
is a state, so each time it changes, the whole component reloads. Is maybe this the root of the problem?Thank you for your feedback.
Best. NC
Reproducer
No response
PrimeReact version
10.3.2
React version
18.x
Language
TypeScript
Build / Runtime
Vite
Browser(s)
No response
Steps to reproduce the behavior
Try changing the page by clicking the bottom selector. It doesn't update (but the data DOES)
Expected behavior
The page selector should update to highlight current page and to show previous/next page.
The text was updated successfully, but these errors were encountered: