Regular expression search with 'OR' condition not working in global search
Regular expression search with 'OR' condition not working in global search
I am trying to get a Regular expression with 'OR' condition to work for the global search. I can get it to work for individual columns using
Idea is that if 2 separate search words are put in the global search with a space in between, the results will get either one of the 2 search words or both (basically an OR operation)
[code]
$('#searchBox').keyup( function(e) {
if(e.keyCode==13){
var arr = $('#searchBox').val().split(' ');
var pattern = (arr[0]) + '|' + (arr[1]);
oTable.fnFilter(pattern, 1, true);
}
} );
[/code]
How do I achieve this for all columns
[code]oTable.fnFilter(pattern, null, true) does not work[/code].
Idea is that if 2 separate search words are put in the global search with a space in between, the results will get either one of the 2 search words or both (basically an OR operation)
[code]
$('#searchBox').keyup( function(e) {
if(e.keyCode==13){
var arr = $('#searchBox').val().split(' ');
var pattern = (arr[0]) + '|' + (arr[1]);
oTable.fnFilter(pattern, 1, true);
}
} );
[/code]
How do I achieve this for all columns
[code]oTable.fnFilter(pattern, null, true) does not work[/code].
This discussion has been closed.