primeng icon indicating copy to clipboard operation
primeng copied to clipboard

Templates and pagination don't work together.

Open jgiro opened this issue 9 years ago • 12 comments

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.

jgiro avatar Dec 25 '16 20:12 jgiro

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.

doronnac avatar Dec 26 '16 13:12 doronnac

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

NikitaForm avatar Dec 26 '16 13:12 NikitaForm

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

nate-knight avatar Dec 27 '16 21:12 nate-knight

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

bogacg avatar Dec 28 '16 12:12 bogacg

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 avatar Dec 28 '16 12:12 NikitaForm

@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

bogacg avatar Dec 28 '16 13:12 bogacg

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

izll avatar Dec 29 '16 12:12 izll

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.

rklempert avatar Dec 30 '16 18:12 rklempert

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.

CG0323 avatar Dec 30 '16 23:12 CG0323

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.

sudheerj avatar Jan 01 '17 10:01 sudheerj

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

on3al avatar Jan 02 '17 20:01 on3al

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

cagataycivici avatar Jan 03 '17 16:01 cagataycivici