Description of problem:
I am trying to filter the rows based on a value selected in a select (which should filter the rows through a data attribute).
$('#roles-select').change(function(){
var role_id = $(this).val();
$.fn.dataTable.ext.search.push(
function(settings,data,dataIndex){
return $(users_table.row(dataIndex).node()).attr('data-role-id') == role_id;
}
);
users_table.draw();
});
The basic example works fine, but when I try to do a different filtering (choosing another value from the select), the filter is done on the rows that have been already filtered.I would need it to be done on the initial rows of the table.
Any idea how to achieve this please?
Thank you very much in advance.