Individual Column Searching for Multiple values
Individual Column Searching for Multiple values
mmcnair80
Posts: 83Questions: 21Answers: 7
Is there a way to use the Text Inputs
to search for multiple values?
For example, I have a table that has a State column. Is there a way to do a search for both AL and AZ? Like typing "AL ,AZ" or "AL ; AZ"?
Here is how I'm initializing the Text Inputs
:
api.columns('.dt-filter-text').every(function ()
{
var that = this;
$('input', this.footer()).on('keyup change', function ()
{
if (that.search() !== this.value)
{
that
.search(this.value)
.draw();
}
});
});
This discussion has been closed.
Answers
I got this to work by modifying my FilterSort.class.php file (a modified version of the ssp.class.php) so that the filter function now has this for the Individual column filtering:
It might not be the most elegant, but it does work!
It looks for a semi-colon and separates out the values based on that.