i want to use individual column search with select input in datatable parellaly i want use pdf
i want to use individual column search with select input in datatable parellaly i want use pdf
sairamgh
Posts: 6Questions: 3Answers: 0
here is the code but both pdf and individual column search using select input not working please help me
$('#myTable').dataTable({
dom: 'Bfrtip',
buttons: [
'excelHtml5',
'pdfHtml5'
]
});. initComplete: function () {
this.api().columns().every( function () {
var column = this;
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.