How fnFilter for an empty string?
How fnFilter for an empty string?
jadymitchell
Posts: 11Questions: 0Answers: 0
I've searched quite a bit on this, with no success. How do I filter for an empty string? This does not work:
oTable.fnFilter( '', 4);
Any help would be appreciated.
oTable.fnFilter( '', 4);
Any help would be appreciated.
This discussion has been closed.
Replies
Thanks,
Vivek
My data is a column of dates (e.g.,2/2/2010). If I do
[code]oTable.fnFilter('2/2/2010', 4)[/code]
it filters to that date. But if the date column is empty and I filter for empty, no luck.
Allan
I can't thank you enough for your quick response and wonderful project (I will be donating!). However, the regex doesn't seem to work either. Here is a sample of the json I have:
[code]["1525","Kenneth ","Jones","08\/17\/2010","","CRIMINAL","asmith",""],["1511","Don","Hamilton","07\/22\/2010","08\/09\/2010","CRIMINAL","asmith","Nolle Pros"],[/code]
Running this code:
[code]fnFilter( '^$', 4, true, false );[/code]
does not return the first record. Help!
[code]oTable.fnFilter( '^$', 4, true, false );[/code]
works fine. Thanks!
For whatever reason, reg expressions are not working on my install. Even tried searching .* and got nothing. Is there anything that would disable the reg ex? Text filters work fine, but special chars are not being interpreted as special.
I double checked the database and the values are empty strings, not null. Have banished NULL from those columns.
[code]
oTable.fnFilter(value, get_column_number(colname), true, false);
console.log(colname, '|'+value+'|', get_column_number(colname));
[/code]
The code jadymitchell posted looks just fine - can you do something like that:
[code]
oTable.fnFilter( '^$', get_column_number(colname), true, false );
[/code]
That will match empty strings.
Allan
I was just unclear if the filtering was running locally even if the rest of the processing is server-side.
thanks.
Allan
Allan