1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73
| $("#filtre_statut").change(function() {
var cell = $(this).val();
if(cell == "" && $("#filtre_pays").val() == "" && $("#filtre_depart").val() == "" && $("#filtre_valide").val() == "" && $("#filtre_nom").val() == "") {
$('.ligne').each(function() {
$(this).css('display', 'table-row');
});
pagination();
} else if(cell == "") {
$('.ligne').each(function() {
$(this).css('display', 'none');
});
if($("#filtre_pays").val() != "") {
$('.ligne').find('.pays:contains('+$("#filtre_pays").val()+')').each(function() {
$(this).parent().css('display', 'table-row');
});
}
if($("#filtre_nom").val() != "") {
$('.ligne:visible').find('.nom:imissing('+$("#filtre_nom").val()+')').each(function() {
$(this).parent().css('display', 'none');
});
}
if($("#filtre_depart").val() != "") {
$('.ligne:visible').find('.depart:missing('+$("#filtre_depart").val()+')').each(function() {
$(this).parent().css('display', 'none');
});
}
if($("#filtre_valide").val() == "Oui") {
$('.ligne:visible').each(function() {
if($(this).attr('id') == "nvalide")
$(this).css('display', 'none');
});
} else if($("#filtre_valide").val() == "Non") {
$('.ligne:visible').each(function() {
if($(this).attr('id') == "valide")
$(this).css('display', 'none');
});
}
} else {
$('.ligne').each(function() {
$(this).css('display', 'none');
});
$('.ligne').find('.statut:contains('+cell+')').each(function() {
$(this).parent().css('display', 'table-row');
});
if($("#filtre_pays").val() != "") {
$('.ligne:visible').find('.pays:missing('+$("#filtre_pays").val()+')').each(function() {
$(this).parent().css('display', 'none');
});
}
if($("#filtre_depart").val() != "") {
$('.ligne:visible').find('.depart:missing('+$("#filtre_depart").val()+')').each(function() {
$(this).parent().css('display', 'none');
});
}
if($("#filtre_nom").val() != "") {
$('.ligne:visible').find('.nom:imissing('+$("#filtre_nom").val()+')').each(function() {
$(this).parent().css('display', 'none');
});
}
if($("#filtre_valide").val() == "Oui") {
$('.ligne:visible').each(function() {
if($(this).attr('id') == "nvalide")
$(this).css('display', 'none');
});
} else if($("#filtre_valide").val() == "Non") {
$('.ligne:visible').each(function() {
if($(this).attr('id') == "valide")
$(this).css('display', 'none');
});
}
$(".pager").css('display', 'none');
}
}); |
Partager