how to datatable select2 dropdown filter

enter image description here
enter image description here

initComplete: function () {
this.api().columns().every( function () {

            var select = $('<select  class="form-control select2 "><option value=""></option></select>');
                .appendTo( $(column.header()).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> ' )
            } );
           
        
        } );
        
    },