PTable / Paginator

UI Components for Angular
Post Reply
kk1687
Posts: 9
Joined: 29 May 2018, 14:32

07 Feb 2020, 11:24

Team,

Here is the plot, I have a ptable with paginator set to true. resetPageOnSort and sortField with customSort is set.

I have a data loaded from a service set as value of table.

Test step 1. I have loaded data, say 100 records with rows set to 20 and I am on page#3.

Test Step 2. I am loading the data again with an updated search criteria. Now the new data with 3 records is loaded and table is updated with the same, paginator link 1 shows activated but the paginatorState is just the same as of previously selected page, ie page#3.

I am constructing a summary message in the paginatorleft template, as the paginator state is not proper its not displaying proper information.

Any workarounds ?

kk1687
Posts: 9
Joined: 29 May 2018, 14:32

10 Feb 2020, 12:41

Work around fix has been tried, changes in primeng\components\table\table.js

-- Table prototype __decorate

Code: Select all

    __decorate([
        core_1.ViewChild('paginatorVC'),
        __metadata("design:type", paginator_1.Paginator)
    ], Table.prototype, "paginatorViewChild");
----------------------------------------------------------------------
--in sortSingle

Code: Select all

                if(this.paginatorViewChild){
                    this.paginatorViewChild.changePage(0);
                }
----------------------------------------------------------------------

Table = __decorate([
core_1.Component({
selector: 'p-table',
template: "\n <div #container ........

Code: Select all

<p-paginator #paginatorVC
...

kk1687
Posts: 9
Joined: 29 May 2018, 14:32

10 Feb 2020, 12:42

Kindly share if any of the updated releases are already having the fix, in any different way.

Post Reply

Return to “PrimeNG”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 2 guests