Need sorting only for table header but not need for filter.Please give solution for my problem

Need sorting only for table header but not need for filter.Please give solution for my problem

sudarsansudarsan Posts: 5Questions: 4Answers: 0

I need to remove sorting when clicking filter on below coding and i have to remove filter for one column.

$(document).ready(function() {
$('#example').DataTable( {
initComplete: function () {
this.api().columns().every( function () {
var column = this;
var select = $('<select><option value=""></option></select>')
.appendTo( $(column.header()) )
.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.