1
Where I have tables on my system, in almost all used the plugin dataTables to customize, but my plugin ta a little modified.
In the modification in question, the search field inside the table is hidden, and I activate it with a 'activate search' button'.
What I want to do activate this search with the keyboard, preferably CTRL+F, do this is simple:
$(document).keydown(function (e) {
if (e.keyCode == 70 && e.ctrlKey) {
$("#dataTable_filter").find('.form-control').show().focus();
}
});
But in this, it activates the default search of the browsers, and moves the focus to this other search, the doubt is:
There is how to disable this default browser search and use only the my trigger? Or you have to do it another way to get this one outworking ?
I add two things: 1) it is not 100% safe to achieve the same effect in every browser; 2) it is extremely wrong, from the point of view of usability, to do this, since you modify a behavior that your user is already used to, and this will bring a bad perception on his part.
– Brunno Vianna
Your answer is right. I’m just warning @anthraxisbr to avoid replacing native browser functions with their own solutions. It causes discomfort and, in terms of UX, it’s terrible.
– Brunno Vianna
I marked your comments as important for him to read.
– Wictor Chaves
I had forgotten the default prevention, it worked right, regarding browser poratabilidade does not difença, it is an intranet system and everyone who uses owns all the programs in the same version on their Pcs.
– AnthraxisBR