I was wondering if it is even possible to filter jQuery DataTable with one of its data attributes, rather than the contents of its cells. To dynamically apply a filter to a column, this call is used:
$table.fnFilter('^(Some value)$', columnIndex, true, false);
This will filter the exact contents of the default cell using regex. However, suppose 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 have a DataTable filter with the exact contents of the attribute data-labelinstead of the contents of the cell. Is the question of determining the type of search when setting up columns in the init table? Or is there a way to define a filter by attribute instead of content?
Sebbo source
share