Column filter for data table with multiple dropdown values

I have one drop below a column of data tables, I want to select multiple values ​​and select once the ones the search should work with these new values. I'm not sure how to match the selected dropdown value to the search function. Can someone figure this out. Here is my code that I have tried.

var dtable = $('#datatable-editable').DataTable();

var myArr = [];

 myArr = $("#skillsList option:selected").map(function() {
        return $(this).val();
    }).get();

dtable.column(9).search( '^'+myArr.join('|')+'$', true, false).draw();

      

0


source to share





All Articles