Pressing esc on column filter
Pressing esc on column filter
GrantSoldge
Posts: 4Questions: 0Answers: 0
Hi everyone,
when I focus on a column filter field, the info text (for example "Search engines") disappears and field is empty. But when I press the esc key without entering any char, the info text appears again and becomes value of the field and column is filtered according to "Search engines".
Have a nice day,
Grant
when I focus on a column filter field, the info text (for example "Search engines") disappears and field is empty. But when I press the esc key without entering any char, the info text appears again and becomes value of the field and column is filtered according to "Search engines".
Have a nice day,
Grant
This discussion has been closed.
Replies
Allan
Grant
[code]
$("tfoot input").keydown(function(e) {
if(e.keyCode == 27) {
$(this).addClass("search_init");
}
});
[/code]
Grant
Allan
[code]
$("tfoot input").keyup(function(i) {
if(i.keyCode == 27) {
this.className = "search_init";
this.value = settings.asInitVals[$("tfoot input").index(this)];
settings.oTable.fnFilter("", $("tfoot input").index(this));
} else {
this.className = "";
settings.oTable.fnFilter(this.value, $("tfoot input").index(this));
}
});
[/code]
Grant