Last active
December 30, 2015 15:19
-
-
Save barakargaman/7847640 to your computer and use it in GitHub Desktop.
filter rows on mode checkbox change
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var modes = ['free_submission_free_day', | |
'paid_submission_free_day', | |
'free_submission_bargain_day', | |
'paid_submission_bargain_day' | |
]; | |
$('input[type="checkbox"]').on('change', function() { | |
var modes_code = _.map(modes, function(i){ ($('.'+i).val()) ? '1' : '.' }).join(); | |
var rex = new RegExp(modes_code, 'i'); | |
$('.searchable tr').hide(); | |
$('.searchable tr').filter(function() { | |
return rex.test($(this).data('modes_code')); | |
}).show(); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment