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

DataTable sorting broken when using pagination #2618

Closed
martinbdz opened this issue Apr 27, 2017 · 8 comments
Closed

DataTable sorting broken when using pagination #2618

martinbdz opened this issue Apr 27, 2017 · 8 comments
Assignees
Labels
Type: Bug Issue contains a bug related to a specific component. Something about the component is not working
Milestone

Comments

@martinbdz
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)
http://plnkr.co/edit/3eU5m4mrjVPWnPTfVGDt

Current behavior
The entries in the table are not sorted.

Expected behavior
The entries in the table should be sorted.

Minimal reproduction of the problem with instructions
Create a DataTable that is not lazy loaded and uses pagination.

  • Angular version:
    4.0.2

  • PrimeNG version:
    PrimeNG 4.0.0-RC2 - PrimeNG 4.0.0-RC4

  • Browser:
    Chrome, Firefox

@bmstambaugh-zz
Copy link

This is weird because I am using the same version in my current app I am developing and the sorting works fine. Also see this plnkr I made yesterday to show a different issue I am having. Sorting is working just fine there. http://plnkr.co/edit/gZGid81oodPX8RwRC4bm

The strange thing is that in your plnkr, in which I presume you used the template just as I had, I am able to reproduce the issue you describe.

I took your example and added more rows so that paging actually has something to do to see if that was the issue, but it was not. However, If you now click on the header to sort and then choose one of the other pages the table will then be sorted by the column you clicked on. http://plnkr.co/edit/lpwwylWn87nKPXqmrqXD

@martinbdz
Copy link
Author

The problem is with the paginator option. Setting it to true causes the issue I am experiencing.

@bmstambaugh-zz
Copy link

bmstambaugh-zz commented Apr 27, 2017

I'm sorry I included the wrong plnk in the first link. I didn't give you the forked version with paginator set to true. Try this one http://plnkr.co/edit/JizxgHpxAdNp6wnT53XS You cannot see the paging which is an affect of the other bug I made the original plnk about, but sorting is working as expected.

@bmstambaugh-zz
Copy link

After some digging I finally agve in and just ran a diff on our two examples and found I had
'primeng': 'npm:primeng@4.0.0-rc.1/primeng.js'
in the systemjs file. Which is why sorting is working as expected in my example. This also happens to be the version in the plnkr we are supposed to fork when creating a bug report, explaining why I had that version.

When I change to rc4 then I too experience the same sorting problems. I also tested **rc.2 and rc.**3 and both seem to be working as expected as well. So it appears that rc4 is when sorting has broken.

@cagataycivici cagataycivici self-assigned this Apr 28, 2017
@cagataycivici cagataycivici added the Status: Pending Review Issue or pull request is being reviewed by Core Team label Apr 28, 2017
@cagataycivici cagataycivici added this to the 4.0.0 milestone Apr 28, 2017
@cagataycivici cagataycivici added Type: Bug Issue contains a bug related to a specific component. Something about the component is not working and removed Status: Pending Review Issue or pull request is being reviewed by Core Team labels Apr 28, 2017
@cagataycivici
Copy link
Member

Try RC5 please.

@lincolnluiz
Copy link

Functioned perfectly, RC5 Angular 4.0.3

@bmstambaugh-zz
Copy link

Looks to here. Thanks for the quick fix @cagataycivici

@Kusuma18
Copy link

Hi @cagataycivici , @bmstambaugh still I see the issue, if paginator=true, sorting is broken, can you please let me know if this is fixed in latest primeng release?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug Issue contains a bug related to a specific component. Something about the component is not working
Projects
None yet
Development

No branches or pull requests

5 participants