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

Two-way binding support for "first" property of Table #6932

Closed
roldengarm opened this issue Nov 29, 2018 · 0 comments
Closed

Two-way binding support for "first" property of Table #6932

roldengarm opened this issue Nov 29, 2018 · 0 comments
Assignees
Labels
Type: Enhancement Issue contains an enhancement related to a specific component. Additional functionality has been add
Milestone

Comments

@roldengarm
Copy link

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

[X ] bug report => Search github for a similar issue or PR before submitting
[ ] feature request => Please check if request is not on the roadmap already https://github.com/primefaces/primeng/wiki/Roadmap
[ ] support request => Please do not submit support request here, instead see http://forum.primefaces.org/viewforum.php?f=35

Plunkr Case (Bug Reports)
https://stackblitz.com/edit/github-g488e6?file=src%2Fapp%2Fapp.component.ts

Current behavior

The original issue is that if you have a data set with e.g. 10 pages, you open page 10, and then the data set changes to 5 pages; you will see an empty list.
So I'm trying to reset the pager back to page 0 when the data changes.
The first property is used for that. However, two-way binding does not work, so it stays at 0 during paging. So, setting it to 0 does not trigger paging.
The workaround is to set it to -1, and set it back to 0 in a setTimeout().

However, the fix should be that two-way binding to the first property works.

Expected behavior
Two-way binding to the first property of the table component works.

Minimal reproduction of the problem with instructions
https://stackblitz.com/edit/github-g488e6?file=src%2Fapp%2Fapp.component.ts

Page through the data set. The first property should update.

When clicking the button, it will decrease the data set & revert back to page 0 using my hack.

  • Angular version: 7.0

  • PrimeNG version: 7.0

  • Browser: Chrome

@cagataycivici cagataycivici self-assigned this Apr 3, 2019
@cagataycivici cagataycivici changed the title Data table "first" two-way binding not working Two-way binding support for "first" property of Table Apr 3, 2019
@cagataycivici cagataycivici added the Type: Enhancement Issue contains an enhancement related to a specific component. Additional functionality has been add label Apr 3, 2019
@cagataycivici cagataycivici added this to the 7.1.1 milestone Apr 3, 2019
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

No branches or pull requests

2 participants