Search on a column based on a class name

Search on a column based on a class name

GiovanniGiovanni Posts: 9Questions: 2Answers: 0

Hi all,
I am using datatables 1.10 and I am trying to filter the column values based on a class name. The content of the specific column can be

<span class="fa-stack fa-lg"><i class="fa fa-square-o fa-stack-2x text-success"></i> <i class="fa fa-map-marker fa-stack-1x text-success"></i></span> or

or

<span class="fa-stack fa-lg"><i class="fa fa-square-o fa-stack-2x " ></i> </span>

based on the value of data source.

The search is applied after clicking on a button with ID tracking.

I am usig the following function but I do not know whta can I put insetad of **** (that in the code below is just a placeholder).

$('#tracking').on( 'click', function () { $('#largeTable').DataTable() .columns(5) .search(*****,false,false ) .draw(); });

I was tryng a way to apply a filter based on the class fa-map-marker. IS it possible anyhow?

Thanks

Giovanni

Answers

  • allanallan Posts: 61,934Questions: 1Answers: 10,154 Site admin

    Hi,

    You need to write a search plug-in if you want to search on class names as DataTables' own built in search will strip HTML tags.

    Allan

This discussion has been closed.