[code]$(‘.filter’).on( ‘click’, function () {
var searchTerm = $(this).text();
if($(this).text() == ‘All’)
{
table.search( ” ).columns().search( ” ).draw();
}
else
{
var searchTermFinal = ‘^’ + searchTerm + ‘$’;
// strict search and match of filter text
console.log(searchTermFinal);
table.column( 1 ).search(searchTermFinal, true, false).draw();
//table.column( 1 ).search( searchTermFinal).draw();
}
} );
I am not able to draw text with whitespace on the DataTable column also not able to use if – else if – else statement in “$(‘.filter’).on( ‘click’, function () {});
Edited by site staff: Inserted code tags: “[code]your code here[/code]