Excluding column from Global search

UI Components for Angular
Post Reply
bentcildev
Posts: 1
Joined: 14 Oct 2016, 16:41

17 Oct 2016, 18:36

In the DataList global filter I want to exclude one (or more) of the columns from being searched. Can someone please point me to the instructions on doing that.

Thanks

tengel92
Posts: 28
Joined: 15 Sep 2016, 20:04

18 Oct 2016, 22:34

Set filter=false. That should set it so that the column isn't included in search. You can find it in the DataTable documentation. You can also change the filter if it contains, starts or ends with values.

Code: Select all

    <p-column field="vin" header="Vin (startsWith)" [filter]="true"></p-column>
    <p-column field="year" header="Year (contains)" [filter]="true" filterMatchMode="contains"></p-column>
    <p-column field="brand" header="Brand (startsWith)" [filter]="true"></p-column>
    <p-column field="color" header="Color (endsWith)" [filter]="true" filterMatchMode="endsWith"></p-column>

Evosys
Posts: 5
Joined: 13 Dec 2016, 18:40

20 Dec 2016, 15:03

The solution above doesn't work.

How can we exclude a column from the global filter ? I don't want to search in a column containing img src.

fibrenoire
Posts: 14
Joined: 18 Jul 2016, 21:26

12 Oct 2017, 16:49

Indeed, this feature would improve datatable ...

User avatar
sudheer
PrimeFaces Core Developer
Posts: 4345
Joined: 16 Oct 2011, 19:19
Location: Singapore

13 Oct 2017, 09:43

Currently it resolves all the column fields(irrespective of filter feature). You can create a github feature request to control this behavior.
Author,Speaker
https://twitter.com/sudheerjonna
Github: https://github.com/sudheerj
Website http://sudheerjonna.com/

___________________
Sudheer Jonna

Post Reply

Return to “PrimeNG”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 13 guests