Primeng: Templates and pagination don't work together.

Created on 25 Dec 2016  路  12Comments  路  Source: primefaces/primeng

Latest version of Angular 2 and PrimeNG.

If I add a template to and have the pagination logic running, the column containing the template is not is not refreshed, it remains always showing the data for the first page. Columns without templates are rendered correctly. The way to insert the template was copied from your site.

All 12 comments

I can confirm this behaviour.
This seems to be a bug in v1.1.2, to solve it I had to revert to v1.0.1.

Confirm. It's not working in v1.1.2. Critical issue.

Good to know. I will revert to 1.0.1. Hopefully this is resolved soon.

I have the same issue. Possibly fix for breaking unexpected change made in latest Angular 2 update broke this one. #1652

I've fixed it in my project with custom rowTrackBy
rowTrackBy(index: number, row: any) { return row.id; }
Just mapped it to corresponded property of p-dataTable
[rowTrackBy]="rowTrackBy"

@NikitaForm Instead of row.id I've used property in my row object that didn't triger template refresh when expected, and it seems to work. Thanks

If this didn't work I'd use this one: How to programmaticaly trigger refresh primeNG datatable when a button is clicked

Hm, It took me half a day before I realized that this error causing, that not refreshing the table :)

Angular 2.4.1 and PrimeNG 1.1.2

Templated columns do not refresh contents when paging or sorting, as mentioned by the original issue creator. Is there an ETA for this to get resolved?

Thank you.

my workaround is using rowIndex and access the correct object via your data array, however, this has another issue... when go to the last page (usually not a full page), then come back to previous page, the rowIndex becomes a very large number... I found that by using rowIndex = rowIndex % pagesize, I can get the correct rowIndex.

This is just an ugly workaround, hope the issue can be fixed soon.

I can replicate the issue with PrimeNG 1.1.2 release as well.There is no issue with 1.1.1.Anybody can confirm on this.

I have replicated the issue in ^1.1.2. Any templated column does not refresh when sorting.

Fixed via #1711, by the way PrimeNG 1.1.3 is released having the fix.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jisqaqov picture jisqaqov  路  3Comments

philly-vanilly picture philly-vanilly  路  3Comments

Faigjaz picture Faigjaz  路  3Comments

jisqaqov picture jisqaqov  路  3Comments

SchneMa picture SchneMa  路  3Comments