Primeng: Sort and Filter support for VirtualScrolling

Created on 13 Aug 2020  路  3Comments  路  Source: primefaces/primeng

*I'm submitting a bug report *

Plunkr Case (Bug Reports)
https://stackblitz.com/edit/github-f1jpot-knw3nx

Current behavior
Clicking on sort of virtual scrollable table doesn't do anything

Expected behavior
Clicking on sort of virtual scrollable table should sort the table

Minimal reproduction of the problem with instructions

Angular version: 9.1.9
PrimeNG version: 9.1.0
Browser: [all]
Language: [all]

  • Angular version: 9.0.4

  • PrimeNG version: 9.1.0

  • Browser: only tried Chrome

LTS-FIXED-9.1.5 enhancement

Most helpful comment

As a workaround until this is fixed you can register a click listener on the th tag

    <ng-template pTemplate="header">
        <tr>
            <th pSortableColumn="vin" (click)="refreshData()">    <-------------
                vin <p-sortIcon field="vin"></p-sortIcon>
            </th>
            <th>
                year
            </th>
        </tr>
    </ng-template>

And in the refreshData method you assign a new reference to the value object

  refreshData(): void {
    this.cars = [...this.cars];
  }

All 3 comments

As a workaround until this is fixed you can register a click listener on the th tag

    <ng-template pTemplate="header">
        <tr>
            <th pSortableColumn="vin" (click)="refreshData()">    <-------------
                vin <p-sortIcon field="vin"></p-sortIcon>
            </th>
            <th>
                year
            </th>
        </tr>
    </ng-template>

And in the refreshData method you assign a new reference to the value object

  refreshData(): void {
    this.cars = [...this.cars];
  }

Thanks Ralscha, we used your workaround with success

Was this page helpful?
0 / 5 - 0 ratings

Related issues

philly-vanilly picture philly-vanilly  路  3Comments

cyberrranger picture cyberrranger  路  3Comments

KannanMuruganmony picture KannanMuruganmony  路  3Comments

jisqaqov picture jisqaqov  路  3Comments

mitosandov picture mitosandov  路  3Comments