DataTables / TableTools

Please note that TableTools has now been retired and replaced by the Buttons and Select extensions which offers significant improvements and API integration with the rest of DataTables and the other extensions.
http://datatables.net/
Other
237 stars 149 forks source link

TableTools not working in nested tab #79

Closed kiempoturner closed 9 years ago

kiempoturner commented 9 years ago

Im working on using TableTools in a nested tab. I've put the tables in separated file. The PDF and other exporting buttons only worked on the first tab. Nothing happens in other tabs except for the Print button. Here's the js file: https://jsfiddle.net/kiempoturner/d0ynemzh/

The Code:

        <!-- BEGIN PAGE CONTENT-->
                <div class="tab-content">

                    <div class="tab-pane active" id="tab_0">
                     <?php include 'table_report.php'; ?>
                    </div>

                    <div class="tab-pane" id="tab_1">
                     <?php include 'table_report_2.php'; ?>
                    </div>

                    <div class="tab-pane" id="tab_2">
                     <?php include 'table_report_3.php'; ?>
                    </div>

                    <div class="tab-pane" id="tab_3">
                     <?php include 'table_report_4.php'; ?>
                    </div>

                    <div class="tab-pane" id="tab_4">
                     <?php include 'table_report_5.php'; ?>
                    </div>

                    <div class="tab-pane" id="tab_5">
                     <?php include 'table_report_6.php'; ?>
                    </div>

                </div>
        <!-- END PAGE CONTENT-->

Asked in SO too : http://stackoverflow.com/questions/28873419/tabletools-not-working-in-nested-tab

DataTables commented 9 years ago

There are a number of discussions about this in the forum - for example.

Basically you need to use the fnResizeButtons API method when the tab is made visible so the Flash movie can be set to the correct size.