JacobTStaggs
JacobTStaggs

Reputation: 107

PrimeNG Global Filter with Multiple Filters

I am working with PrimeNG and I have a table that is using global filters. I have it currently where it only filters off of the default "field."

  <div class="searchbar">
    <span class="icon-search"><i class="icon-Search"></i></span>
    <input  class="filter" type="text" pInputText size="50" placeholder="Search" (input)="EmptyTask.filterGlobal($event.target.value, 'contains')">

That works fine but it is only looking at the first column so I figured I would use the [globalFilterFields] option like this: [globalFilterFields]="['field, first_name, last_name]"

With field being an ID. If I have that set it does not return anything whenever I start searching for any of the fields. Here is how the data is setup in the component.ts:

 {
      field: 'ID',
      first_name: 'first_name',
      last_name: 'last_name',
 }

But when I type in the name of a person on the table it does not return the entries that match.

Upvotes: 0

Views: 2922

Answers (1)

JacobTStaggs
JacobTStaggs

Reputation: 107

Was a combination of two things. First being I had to turn off lazy loading and the second being I had some quotations messed up.

Upvotes: 1

Related Questions