fnFilter regex question/issue
fnFilter regex question/issue
Hi Allan and folks,
I'm trying to use the fnFilter function with a regex, and it's not working as (I think) it should.
What I have is a column with only two possible options: 'entered' and 'un-entered.' While filtering on 'un-entered' works fine, when the user chooses 'entered', of course it captures all of the 'un-entered' values too!
So, I've tried using variations on this, none of which seem to work:
if ($(this).val() == 'Entered') {
dt.fnFilter( "[^u]", i, false );
} else {
dt.fnFilter( $(this).val(), i );
}
I've tried various regexps like "[^Uu]," "[^un-]", "[^-]", etc...any of those should theoretically work, but it either doesn't seem to filter at all, or I get a complete empty set of results.
I'm aware of the regex line in the code that this is getting put inside, but I'm not quite good enough at regexps to figure out what I may have to add to make this work..
var sRegExpString = '^(?=.*?'+asSearch.join( ')(?=.*?' )+').*$';
Anyone have any ideas?
Thank you!
Best,
Dave
I'm trying to use the fnFilter function with a regex, and it's not working as (I think) it should.
What I have is a column with only two possible options: 'entered' and 'un-entered.' While filtering on 'un-entered' works fine, when the user chooses 'entered', of course it captures all of the 'un-entered' values too!
So, I've tried using variations on this, none of which seem to work:
if ($(this).val() == 'Entered') {
dt.fnFilter( "[^u]", i, false );
} else {
dt.fnFilter( $(this).val(), i );
}
I've tried various regexps like "[^Uu]," "[^un-]", "[^-]", etc...any of those should theoretically work, but it either doesn't seem to filter at all, or I get a complete empty set of results.
I'm aware of the regex line in the code that this is getting put inside, but I'm not quite good enough at regexps to figure out what I may have to add to make this work..
var sRegExpString = '^(?=.*?'+asSearch.join( ')(?=.*?' )+').*$';
Anyone have any ideas?
Thank you!
Best,
Dave
This discussion has been closed.