Link to home
Start Free TrialLog in
Avatar of Klaus Talkenberger
Klaus TalkenbergerFlag for Germany

asked on

Special Filter for only One Column

Hello everybody

Is there a way to use a special search / filter for a column? All other columns should be filtered with the standard Datatable Filter. I don't want to use a second input field for the filter.

Example data:
<table>
<tr><td>123</td><td>abc</td><td>xxx</td><td><input type="text" value="234"/><i class="fasfa-check"></i></td></tr>
<tr><td>555</td><td>abc</td><td>ddd</td><td><input type="text" value="123"/><i class="fasfa-check"></i></td></tr>
<tr><td>456</td><td>abc</td><td>hhh</td><td><input type="text" value="120"/><i class="fasfa-check"></i></td></tr>
<table>

Open in new window


If you enter "123" in the search field of the table, the result should be records 1 and 2.

Accordingly, the HTML tags would have to be filtered out in column 4 and only searched for the value.

I hope someone has an idea.

thank you in advance

Talki
Avatar of Ryan Chong
Ryan Chong
Flag of Singapore image

I guess you mean filter for each column?

if yes, then check this out

Column filtering
https://datatables.net/extensions/fixedheader/examples/options/columnFiltering.html
Hi,

The easiest way and best way to do that is using Yadcf plugin https://yadcf-showcase.appspot.com/
I'm using Yadcf for all my datatables tables, this is flexible and powerful, i do prefer the externally triggered way
https://yadcf-showcase.appspot.com/dom_source_externally_triggered.html

It is very powerfull compare of the Datatables search.

Documentation about  filtering https://datatables.net/plug-ins/filtering/

For the ordering you may wan to check the sorting plugin https://datatables.net/plug-ins/sorting/
Avatar of Klaus Talkenberger

ASKER

Hello everybody

Thank you for the answers ...
Unfortunately, that doesn't suit me ...

I just want to enter the search term using the standard search.
The fourth column contains HTML with an input and an image.

You want to search in the value of the input field ...

If you enter 456, the first two lines must be displayed.
Row 1 hits in column 4 and row 2 hits in column 3.

User generated image
Unfortunately I haven't found a solution yet :-(
ASKER CERTIFIED SOLUTION
Avatar of lenamtl
lenamtl
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
hello lenamtl

That's exactly what I was looking for.
Thank you very much, you helped me a lot.

greeting

Talki