I want to be able to sort a table using two different sets of checkboxes. One factor is region and the other is num. So they would both be referring to different columns while filtering both of them simultaneously.
$( "input").prop('checked', false);
$("input:checkbox").click(function () {
var showAll = true;
$('tr').not('.head').hide();
$('input[type=checkbox]').each(function () {
if ($(this)[0].checked) {
showAll = false;
var status = $(this).attr('rel');
var value = $(this).val();
$('td.' + status + '[rel="' + value + '"]').parent('tr').show();
console.log('td.' + status + '[rel="' + value + '"]');
}
});
if(showAll){
$('tr').show();
}
});
Aucun commentaire:
Enregistrer un commentaire