hjalmers / angular-generic-table

A generic table for Angular 2+. Generic table uses standard markup for tables ie. table, tr and td elements etc. and has support for expanding rows, global search, filters, sorting, pagination, export to CSV, column clicks, custom column rendering, custom export values.
https://hjalmers.github.io/angular-generic-table/
MIT License
104 stars 55 forks source link

Page not set to active when using goToPage method #282

Closed pkparadigm closed 5 years ago

pkparadigm commented 5 years ago

I am using the generic table. , I am trying to put the user back to the page, where he was previously. I am doing this in ngAfterViewInit(), . The following is the code in ngAfterViewInit. The code takes the user back to the correct page. But the page number at the bottom does not get the "active" style.

ngAfterViewInit() { if(this._route.snapshot.queryParams.page){ window.setTimeout(() => this.genericTable.goToPage(this._route.snapshot.queryParams.page)) } }

Please do let me know if I am missing something. Thanks.

pkparadigm commented 5 years ago

This was because, I was trying to pass a string(like "5") instead of a number(like 5). Closing this issue.

hjalmers commented 5 years ago

Glad to hear you found the issue:)