The Datatable has two filters for searches:
- A regular
text input - A
Statusselect
With the first filter, the table works as expected.
The second filter is a select that filters the status (Active or Inactive) without being text-based like the first filter.
The problem is the following:
Let's say I type d in the search input and no status is selected:
I'm getting 4 entries.
This is the text I get:
Showing 1 to 4 of 4 entries (filtered from 7 total entries)
If I select now a status, for example Active, I get 3 results.
This is the text I get:
Showing 1 to 4 of 4 entries (filtered from 7 total entries)
But it should be: Showing 1 to 3 of 3 entries (filtered from 7 total entries)
I think the problem is that I would have to redraw the table after applying the non-text based filter. But I do not know how to do that.
What I've tried (not working, since I am hiding the rows using CSS):
$('#search2').on('change', () => {
const state = $("#search2").val();
if (state === "none") {
$(".status-active").parent().parent().attr("hidden", false);
$(".status-inactive").parent().parent().attr("hidden", false);
return;
}
$(".status-" + ((state === "active") ? 'inactive' : 'active')).parent().parent().attr("hidden", true);
$(".status-" + state).parent().parent().attr("hidden", false);
DT1.search(state).draw();
});
How can I fix this?

