How to achieve permissive instead of restrictive custom filtering?
How to achieve permissive instead of restrictive custom filtering?
Hello,
With custom filtering, I can add my own function to the filtering function stack. But I have a problem: the filtering seems restrictive instead of permissive.
Filtering is permissive within a filter function within a row, which is to say: if any one cell gets a true
from the function, that filter function approves of the row. However the opposite seems to be the case between the different filter functions, in that if any one filter function disapproves of the row - that is to say all cells in the row got a false
from that filter function - then the row will be hidden, no matter if other filter functions approve of the row or not.
To show by example: the code below does not alter the behavior of the default filtering, row will be hidden if the default filter does not approve of them...
function customFilter( oSettings, aData, iDataIndex ) {
return true;
}
$.fn.dataTableExt.afnFiltering.push(customFilter);
...whereas the following code...
function customFilter( oSettings, aData, iDataIndex ) {
return false;
}
$.fn.dataTableExt.afnFiltering.push(customFilter);
...means that no results will ever be shown.
i want to achieve the opposite; that if a filter function ever approves of a cell, then the row that contains the cell will always be shown. How can I do this?
Best regards
/Michael