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.

Home Page:https://hjalmers.github.io/angular-generic-table/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Page not set to active when using goToPage method

pkparadigm opened this issue · comments

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.

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

Glad to hear you found the issue:)