Display none on table tools breaks buttons

Display none on table tools breaks buttons

danny3388danny3388 Posts: 1Questions: 1Answers: 0

Hi,
I am having an issue with the table tools plugin.
I am trying to hide the buttons until a user clicks on an element on the page but it seems to break the buttons if I do this.
They work fine if I dont set the css on the DTTT_container to display:none; but as soon as I do the buttons no longer work.

I assume this is something to do with the buttons not being able to be seen by the dom or something similar.
So I tried to hide the buttons after the initial render like so but still they break.

var tableTools = new $.fn.dataTable.TableTools( table, {
        "buttons": [
            "copy",
            "csv",
            "xls",
            "pdf",
            { "type": "print", "buttonText": "Print me!" }],
        "sSwfPath": "../application/assets/plugins/datatables/copy_csv_xls_pdf.swf"
} );

$( tableTools.fnContainer() ).insertAfter('#export-btn');
$( tableTools.fnContainer() ).css('display','none');

Can anyone help?

Thanks.

Answers

This discussion has been closed.