Peter Huang
Peter Huang

Reputation: 1178

JQuery datatable how to do search multiple value within single column using OR logic

for example, there is a column index of 7 about Source. I want to filter out all Source from A or B to be my result by typing A,B in the search input box. the format A,B is flexible, it can be A|B, A B.

Thanks for any help.

Upvotes: 16

Views: 39147

Answers (2)

Love Kumar
Love Kumar

Reputation: 1124

100% Working Multiple value search single column

var oTable = $('#intrestTable1').DataTable( {});
oTable.column(5).search("caod|bullet",true,false).draw();

Upvotes: 13

zchpit
zchpit

Reputation: 3121

Use regexp: https://datatables.net/forums/discussion/6946/multiple-filters-on-same-column

Go to: http://www.datatables.net/release-datatables/examples/api/regex.html

  • In column: Column - Office
  • Put: tokyo|london
  • And check: Treat as regex

Upvotes: 10

Related Questions