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

Templates and pagination don't work together. #1679

Closed
jgiro opened this issue Dec 25, 2016 · 12 comments
Closed

Templates and pagination don't work together. #1679

jgiro opened this issue Dec 25, 2016 · 12 comments

Comments

@jgiro
Copy link

jgiro commented Dec 25, 2016

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.

@doronnac
Copy link

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.

@NikitaForm
Copy link

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

@nate-knight
Copy link

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

@bogacg
Copy link

bogacg commented Dec 28, 2016

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

@NikitaForm
Copy link

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"

@bogacg
Copy link

bogacg commented Dec 28, 2016

@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

@izll
Copy link

izll commented Dec 29, 2016

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

@rklempert
Copy link

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.

@CG0323
Copy link

CG0323 commented Dec 30, 2016

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.

@sudheerj
Copy link
Contributor

sudheerj commented Jan 1, 2017

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.

@on3al
Copy link

on3al commented Jan 2, 2017

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

@cagataycivici
Copy link
Member

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests