I was wondering if it is at all possible to filter a jQuery DataTable by one of its data attributes instead of the contents of its cells. To dynamically apply a filter to a column, one uses this call:
$table.fnFilter('^(Some value)$', columnIndex, true, false);
This will filter the exact contents of the cell by default using regex. However, assume that my cells are structured this way:
<td data-label="Active"><i class="fa fa-check fa-lg"></i></td>
Or
<td data-label="Active">Active<br /><span class="mute">Some text</span></td>
I would like to be able to have the DataTable filter by the exact content of the attribute data-label
instead of the cell contents. Is it a matter of defining the search type when setting up columns on table init? Or is there a way to define to filter by attribute instead of contents?