primeng icon indicating copy to clipboard operation
primeng copied to clipboard

Table: Global filter match mode NOT_CONTAINS does not work

Open sotjdisc opened this issue 1 year ago • 3 comments

Describe the bug

Global filtering a table with match mode 'notContains' does not work

Environment

Reproducible at stackblitz

Reproducer

https://stackblitz.com/edit/cx2ynl?file=src%2Fapp%2Fdemo%2Ftable-filter-menu-demo.html

Angular version

17.2.2

PrimeNG version

17.10.0

Build / Runtime

Angular CLI App

Language

TypeScript

Node version (for AoT issues node --version)

Stackblitz node version

Browser(s)

Chrome 122.0.6261.112

Steps to reproduce the behavior

Type on the global search box 'James'.

Expected behavior

All rows containing 'James' must be filtered out.

sotjdisc avatar Mar 11 '24 11:03 sotjdisc

I am uncertain whether this qualifies as a bug.

So the logic is that it runs the filter logic on the fields in the 'globalFilterFields' arrays and returns all the row that returned at least one true.

In the provided example, the ‘globalFilterFields’ attribute is set to [‘name’, ‘country.name’, ‘representative.name’, ‘status’] with the ‘notContains’ match mode. The expectation is that the first row should be filtered out because it contains the name ‘James’ in the name field. However, due to the logic searching against other fields and returning ‘true’, the row is still included. To achieve the desired behavior, consider narrowing the ‘globalFilterFields’ to only include the ‘name’ field, as follows: [globalFilterFields]=‘[‘name’]’.

dobanisola-scottlogic avatar Apr 24 '24 14:04 dobanisola-scottlogic

This issue has been automatically marked as stale. If this issue is still affecting you with the latest version, please leave any comment, and we will keep it open. We are sorry that we have not been able to prioritize it yet. If you have any new additional information, please include it with your comment!

github-actions[bot] avatar Aug 23 '24 01:08 github-actions[bot]

Still persists

sotjdisc avatar Aug 23 '24 06:08 sotjdisc