Example Fiddle
I have an html table:
_A_B_C_D_
|0|1|0|1|
|0|1|0|0|
|1|0|0|1|
I want to filter non-zero columns. Using jQuery dataTables (not a hard requirement, just what I am currently using) I execute the following filter:
// value is the column index, true simply informs the filter method to use regex
dataTable.fnFilter("[^0]", value, true);
However, filtering multiple columns creates an AND filter. Thus:
dataTable.fnFilter("[^0]", 0 /*A*/, true);
dataTable.fnFilter("[^0]", 3 /*D*/, true);
would create the following
_A_B_C_D_
|1|0|0|1|
I need OR behavior though which would create the following table:
_A_B_C_D_
|0|1|0|1|
|1|0|0|1|
Where Column A is non-zero OR Column D is non-zero. I cannot think of any way to implement this with my current structure.
How can I filter table columns using OR logic as apposed to AND?