Primeng: p-table: filter not working on 9.1.0

Created on 25 May 2020  路  11Comments  路  Source: primefaces/primeng

I'm submitting a ... (check one with "x")

[x ] bug report => Search github for a similar issue or PR before submitting
[ ] feature request => Please check if request is not on the roadmap already https://github.com/primefaces/primeng/wiki/Roadmap
[ ] support request => Please do not submit support request here, instead see http://forum.primefaces.org/viewforum.php?f=35

Plunkr Case (Bug Reports)
Please demonstrate your case at stackblitz by using the issue template below. Issues without a test case have much less possibility to be reviewd in detail and assisted.

https://stackblitz.com/edit/github-yjs23x

Current behavior
Does not filter.

Expected behavior
Should filter.

Minimal reproduction of the problem with instructions
Try a filtering.

What is the motivation / use case for changing the behavior?
Filter table data.

Please tell us about your environment:
Windows 10

  • Angular version: 5.X
    9.1.9

  • PrimeNG version: 5.X
    9.1.0

  • Browser: [all | Chrome XX | Firefox XX | IE XX | Safari XX | Mobile Chrome XX | Android X.X Web Browser | iOS XX Safari | iOS XX UIWebView | iOS XX WKWebView ]
    all

  • Language: [all | TypeScript X.X | ES6/7 | ES5]
    all

  • Node (for AoT issues): node --version =
    12+

Most helpful comment

@yigitfindikli this has been wrongfully closed. I think the issue was misunderstood. Should I create a new issue?

All 11 comments

Hi,
Built-in filter doesn't work with lazy tables. You can use the onLazyLoad event when filtering. There is an example usage onLazyLoad event: https://stackblitz.com/edit/github-yjs23x-vpcjtp .
A little tip: If you want to use PrimeNG built-in filters you can use with PrimeNG FilterUtils https://primefaces.org/primeng/showcase/#/filterutils

Hi, the filter table data is not working in your case, because _virtualScroll_ property is set to true. This is causing an error (ExpressionChangedAfterItHasBeenCheckedError) in cdkVirtualScrollViewport component (see the screenshot) and that's why filtering and sorting of the table is not working correct. I saw the error when started PrimeNg project and set this property to true, but in your demo I can't see the error. Still I think that your issue is caused by the same error.

error

When _virtualScroll_ property is set to false, then filtering and sorting of the table is working fine, but you are losing the virtual scroll functionality.

Is there any fix to this one? IMHO virtualScroll seems to be useless, if filtering and sorting is not possible.
I have created a (not) working demo: https://stackblitz.com/edit/primeng-tab-virtual-scroll-no-filter

Hi,
Built-in filter doesn't work with lazy tables. You can use the onLazyLoad event when filtering. There is an example usage onLazyLoad event: https://stackblitz.com/edit/github-yjs23x-vpcjtp .
A little tip: If you want to use PrimeNG built-in filters you can use with PrimeNG FilterUtils https://primefaces.org/primeng/showcase/#/filterutils

Not sure what happened here? Why is it closed? The example I provided does not use the lazy functionnality. Still not working.

Same problem. I have a p-table with [virtualRowHeight]="33" [virtualScroll]="true" and sort no longer works.
Removing virtualScroll restores sort functionality.

@yigitfindikli this has been wrongfully closed. I think the issue was misunderstood. Should I create a new issue?

Same problem:
I don't use lazy tables.

selectionMode="single" (onRowSelect)="onRowSelect($event)" [(selection)]="selectedOrder"
[scrollable]="true"
[scrollHeight]="'calc(100vh - 301px)'" [rows]="orders.length"
[virtualRowHeight]="34"
[virtualScroll]="true">

Filter doesn't work anymore. Also get error
handleError Error: ExpressionChangedAfterItHasBeenCheckedError: Expression has changed after it was checked. Previous value for 'height': '18938px'. Current value: '612px'.

@cagataycivici this issue should not be closed.

This is still not working. Please reopen the issue.

A better title for my problem would be: "p-table: when virtualScroll enabled sort not working on 9.1.0"

I (re)created an issue for it:
https://github.com/primefaces/primeng/issues/9154 : p-table: when virtualScroll enabled sort not working on 9.1.0

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Helayxa picture Helayxa  路  3Comments

garethlewis picture garethlewis  路  3Comments

mitosandov picture mitosandov  路  3Comments

miresk picture miresk  路  3Comments

KannanMuruganmony picture KannanMuruganmony  路  3Comments