DataTables with child datatable and a column filter
DataTables with child datatable and a column filter
Man123
Posts: 4Questions: 3Answers: 0
My Column filter dropdown is not working for the child table..
i am using
initComplete: function () { //create dropdown selection for a column
var column = this;
var api = this.api();
api.columns().indexes().flatten().each(function (i) {
var column = api.column(i);
var select = $('<select><option value=""></option></select>')
.appendTo($(column.footer()).empty())
.on('change', function () {
var val = $.fn.dataTable.util.escapeRegex(
$(this).val()
);
column
.search(val ? '^' + val + '$' : '', true, false)
.draw();
});
column.data().unique().sort().each(function (d, j) {
select.append('<option value="' + d + '">' + d + '</option>')
});
});
}
This discussion has been closed.