Problem with fnFilter
Problem with fnFilter
Hi, I've the following code in place:
[code]
var delay = (function(){
var timer = 0;
return function(callback, ms){
clearTimeout (timer);
timer = setTimeout(callback, ms);
};
})();
$('#quick_search').live('keyup', function() {
delay(function(){
var SearchTerm = $("#quick_search").val();
if (SearchTerm.length == 1) {
oTable.fnFilter("^"+SearchTerm, 1, true,false);
} else {
oTable.fnFilter(SearchTerm);
}
}, 1000 );
});
[/code]
This code filters rows starting with a character in second column if only one character is supplied. Which it does. However, when the character is removed, it does not return the table to it's unfiltered state.
Did I miss something? Before I added the
[code]
if (SearchTerm.length == 1) {
oTable.fnFilter("^"+SearchTerm+"", 1, true,false);
}
[/code]
condition it used to work.
Thanks
[code]
var delay = (function(){
var timer = 0;
return function(callback, ms){
clearTimeout (timer);
timer = setTimeout(callback, ms);
};
})();
$('#quick_search').live('keyup', function() {
delay(function(){
var SearchTerm = $("#quick_search").val();
if (SearchTerm.length == 1) {
oTable.fnFilter("^"+SearchTerm, 1, true,false);
} else {
oTable.fnFilter(SearchTerm);
}
}, 1000 );
});
[/code]
This code filters rows starting with a character in second column if only one character is supplied. Which it does. However, when the character is removed, it does not return the table to it's unfiltered state.
Did I miss something? Before I added the
[code]
if (SearchTerm.length == 1) {
oTable.fnFilter("^"+SearchTerm+"", 1, true,false);
}
[/code]
condition it used to work.
Thanks
This discussion has been closed.
Replies
Had to do a
[code]
oTable.fnFilter("", 1, false,false);
[/code]
to "unfilter" first. :-)