J'ai cette fonction qui marche très bien qui permet de rechercher dans mon tableau
Code : Tout sélectionner
// recherche dans le tableau
$("#search").keyup(function(){
_this = this;
$.each($("table tbody tr"), function() {
if($(this).text().toLowerCase().indexOf($(_this).val().toLowerCase()) === -1)
$(this).hide();
else
$(this).show();
});
});
J'aimerais l'adapté pour la recherche dans une seul colonne mais cela ne fonctionne pas, dans ma fonction je récupère bien le champs dans ma liste sélectionné
Code : Tout sélectionner
$("#search_service").on("change", this, function(event) {
_this = this;
$.each($("table tbody tr"), function() {
if($(this).text().toLowerCase().indexOf($(_this).val().toLowerCase()) === -1)
$(this).hide();
else
$(this).show();
});
}); Merci de votre aide.