I'm using this code trying to implement dropdowns for all columns in jQuery-Datatables [like in this example](https://datatables.net/examples/api/multi_filter_select.html).

```
var table = $('#myTable').DataTable({
        dom: 'lfBrtip',
        buttons: [
        {
            extend: 'copy',
            footer: true
        },
        {
            extend: 'csv',
            footer: true
        },
        {
            extend: 'excel',
            footer: true
        },
        {
            extend: 'pdf',
            footer: true
        }
    ],
        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>' )
            } );
        } );
.......
    }

```

Imediately there are problems with this as u can see in the pictures:

**1. Clicking the dropdowns makes the columns sort and i don't want that.**
[![enter image description here](https://i.stack.imgur.com/HR3fs.jpg)](https://i.stack.imgur.com/HR3fs.jpg)

**2. The buttons get inserted in the export.**
[![enter image description here](https://i.stack.imgur.com/QSEdc.jpg)](https://i.stack.imgur.com/QSEdc.jpg)

What am i doing wrong or how can i correct it? Maybe a workaround?

---

**Updated with buttons:[ ]**