highlight search field by having the focus
highlight search field by having the focus
silens
Posts: 101Questions: 40Answers: 0
I would like that when I click on a field in the table and this field appears in the table search, this search engine will be highlighted in some way, changing the color for example
"initComplete": function (settings, json) {//Hace una busqueda haciendo click sobre el campo
var api = this.api();
api.$('td').not(" :nth-child(1),:nth-child(7), :nth-child(9)").click(function () {
$( ".input" ).css( "border", "3px solid red" );
api.search(this.innerHTML).draw();
});
},
This question has accepted answers - jump to:
This discussion has been closed.
Answers
Interesting idea. I think if you change the selector to something like this it should work:
$( ".dataTables_filter input" ).css( "border", "3px solid red" );
Kevin
Thank you very much it works very well, the problem I have is when the entry is deleted, I do not know how to leave it as it was. I do not know what css to put
If the entry is deleted, I'm not clear on why you would want to leave it as it was. Would you not remove it?
Allan
What I want to say is that when I erase the field, I have to remove the color css that I have put before. If the field has no text, it does not have to have color modification. and I do not know what to do to restore his status
Lo he solucionado de esta forma. Muchas gracias @allan
That will do - thanks for posting back!
Allan