Primeng: DataTable sorting broken when using pagination

Created on 27 Apr 2017  路  8Comments  路  Source: primefaces/primeng

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

defect

Most helpful comment

Try RC5 please.

All 8 comments

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

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

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.

After some digging I finally agve in and just ran a diff on our two examples and found I had
'primeng': 'npm:[email protected]/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.

Try RC5 please.

Functioned perfectly, RC5 Angular 4.0.3

Looks to here. Thanks for the quick fix @cagataycivici

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?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

just-paja picture just-paja  路  3Comments

Faigjaz picture Faigjaz  路  3Comments

KannanMuruganmony picture KannanMuruganmony  路  3Comments

jisqaqov picture jisqaqov  路  3Comments

garethlewis picture garethlewis  路  3Comments