Global Search with RegEx only checking column 0?
Global Search with RegEx only checking column 0?
Should a global search with RegEx check all columns (not just column 0)?
Using the interface at
https://datatables.net/examples/api/regex.html
In the Global Search:
If I enter 'Ash', leave the SmartSearch checked - I get 2 results. Good.
If I enter 'Ash', check RegEx, uncheck Smart Search - I get 2 results. Good.
If I enter '^Ash', check RegEx, uncheck Smart Search - I get 1 result, beginning with 'Ash'. Good - we know the regex functionality is working.
If I enter 'Acc', check RegEx, uncheck Smart Search - I get 2 results, with Accountant from the 2nd column. Good.
If I enter '^Acc', check RegEx, uncheck Smart Search - I get no results....
Shouldn't I get the same two results even though the results would come from the second column?
Thanks!
Answers
FWIW...and just to hear the shriek/gasp for this solution - I changed the _fnFilter from:
to ....
I realize this relies on making sure the smartSearch flag is set to false when setting up the search. It certainly blows up should a column have 2+ sequential spaces in it...but it does give me the behavior I was expecting when doing a global search using a regular expression.
If there is a better way around this - please let me know!