Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

like image 445
Peter Huang Avatar asked Sep 12 '14 16:09

Peter Huang


2 Answers

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
like image 141
zchpit Avatar answered Oct 23 '22 03:10

zchpit


100% Working Multiple value search single column

var oTable = $('#intrestTable1').DataTable( {});
oTable.column(5).search("caod|bullet",true,false).draw();
like image 31
Love Kumar Avatar answered Oct 23 '22 04:10

Love Kumar