Multi select filter with changing data
Multi select filter with changing data
Hi everyone
There a jsfiddle : https://jsfiddle.net/zkugnpq5/2/
First, I used this method : https://datatables.net/release-datatables/examples/api/multi_filter_select.html
In a certain cell, I got a dropdown list (select). I actually get the multi_filter_select search to works for those dropdown list (so it display the selected option) using this :
$.fn.dataTableExt.ofnSearch['html-input'] = function(value) {
return $(value).val();
};
columnDefs: [
{ "type": "html-input", "targets": [specialSearchIndex] }
],
My problem is when another option is chosen, it will still display it in the search box. Worse than that, when you search again in the multi_select_filter it will display the last selected value. So it changes in the DOM but not for the DataTable.
I know there is a system that have to kind of reload the datatable if it changes, so I used this :
table.cell().invalidate().draw();
but it didn't work
How could I achieve that ?
thanx for help
Answers
Did you try:
$('input').val('').change();
$(".yourtable").DataTable().search("").draw();