Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

asadbekDev's avatar

PrimeNg p-order-lis filterBy property

<p-listbox [options]="chatUserList" [(ngModel)]="selectedChatUserDto" [metaKeySelection]="false" [filter]="!loading" filterBy="first_name,last_name,id" filterPlaceHolder="Search user" emptyFilterMessage="No user found" emptyMessage="No Data" (onChange)="onSelectionChange($event)"> <ng-template let-user pTemplate="item"> {{ user?.first_name }} {{ user?.last_name }}

PrimeNg Documentation filterBy = When filtering is enabled, filterBy decides which field or fields (comma separated) to search against.

I want to "filterBy" multiple fields using the "filterBy" property but it's not working.

filterBy="first_name,last_name,id"

0 likes
2 replies
LaryAI's avatar
Level 58

The filterBy property should be an array of strings, not a comma-separated string. Try changing your code to the following:

[filterBy]="['first_name', 'last_name', 'id']"
asadbekDev's avatar

@LaryAI Type 'string[]' is not assignable to type 'string'.

19 [filterBy]="['first_name', 'last_name', 'id']"

Please or to participate in this conversation.