Table length and table export

Table length and table export

lvmlvm Posts: 1Questions: 1Answers: 0

I'm trying to use export buttons to download/copy/print my table, however when I include the relevant lines I lose my table length selector.
I've tried playing with the different dom types to no avail and now trying to use tableTools, however it seems I am out of my depth.
Here is my latest failed attempt:

        $(document).ready(function() {
            var table = $('#myTable').DataTable( { 
                "dom": 'T<"clear">lfrtip', 
                "Buttons": [ 
                        "copy", 
                        "print", 
                        "csv", 
                        "xls", 
                        "pdf" 

                    ]
                });
            $('#search-category').on('change',function(){
                table
                .column(3)
                .search(this.value)
                .draw();
            }),
            $('#search-sub-category').on('change',function(){
                table
                .column(4)
                .search(this.value)
                .draw();
            })
        } );

This is the only stable code I could write however It's missing any of the export buttons:
https://jsfiddle.net/jkczwtbt/

Hoping someone could point me where I'm tripping up.

This discussion has been closed.