I have a search bar on my page that uses JQuery to filter my gridview. I can't figure out how to have it filter on multiple values; using a delimiter to determine the different values.
So if I put in the search bar: Dog, Blue It would recognize the coma as a delimiter and first filter the table and hide any rows that don't contain Dog and then also hide any rows that don't contain Blue.
Here's my code for what I have now only being able to enter one word.
//Filter Grid logic
$("tbody").attr('class', 'searchable');
$('input.filter').on('keyup', function () {
var rex = new RegExp($(this).val(), 'i');
$('.searchable tr').hide();
$('.searchable tr').filter(function () {
return rex.test($(this).text());
}).show();
//Always show the Header row
$('tr.GridViewHeader').show();
});
});
Thanks for any help!