Buttons Blue and no export inside tabs?

Buttons Blue and no export inside tabs?

dgodfatherdgodfather Posts: 4Questions: 2Answers: 0

Answers

  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin

    Because the table is hidden when it is initialised you need to call the fnResizeButtons API method to have the Flash button fill the visible button when it is made visible. You'd need to listen for whatever event the tab control emits when that happens.

    There is an example of this for the new Buttons extension's Flash module (that API isn't applicable here since you are using TableTools, but it demonstrates the idea).

    Other options are to update to Buttons and use the Flash module, or use the HTML5 export module which doesn't have that issue, but does require IE10+ or any of the other evergreen browsers.

    Allan

  • dgodfatherdgodfather Posts: 4Questions: 2Answers: 0
    <script>
    $(document).ready( function () {
        $('#table1').dataTable( {
                    aLengthMenu: [[-1, 10, 25, 50, 100, 200, 300, 400, 500],[ "All", 10, 25, 50, 100, 200, 300, 400, 500]],
                    iDisplayLength: 25,
            dom: 'T<"clear">lfrtip',
                    responsive: 'true',
            oTableTools: {
                'sSwfPath': "http://fitapproach.com/wp-content/datatables/extensions/TableTools/swf/copy_csv_xls_pdf.swf"
            }
        } );
       jQuery('#applications').click(function() {
                var jqTable = jQuery('#table1.display');
                if ( jqTable.length > 0 ) {
                    var oTableTools = TableTools.fnGetInstance(jqTable[0]);
                    if ( oTableTools.fnResizeRequired() )
                    {
                        jqTable.dataTable().fnAdjustColumnSizing();
                        oTableTools.fnResizeButtons();
                    }
                }
       });
    } );
    </script>
    

    My latest script as shown above isn't working. Any suggestions?

  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin

    Is the table actually visible at the point when oTableTools.fnResizeButtons(); runs? A breakpoint or additional debug code would be able to check that.

    Allan

This discussion has been closed.