TableTools not showing up

TableTools not showing up

ramtamtamramtamtam Posts: 4Questions: 2Answers: 0
edited January 2015 in Free community support

Hi,

i got a problem with TabelTools. They just didn't show up.
I tried the new init and the old either.

With the new one i got an js-error on line var tt = .... Uncaught TypeError: undefined is not a function

$.ajax({
   url: 'sources/report_table_3.html',
   cache: false,
   success: function(html){
      $('#report-data').html(html);
      var table = $('#report-datatable').dataTable();
      var tt = new $.fn.dataTable.TableTools(table);
      $(tt.fnContainer()).insertAfter('div.info');
}
});

With the old init i got no error and no TableTools.

$.ajax({
            url: 'sources/report_table_3.html',
            cache: false,
            success: function(html){
                $('#report-data').html(html);
                $('#report-datatable').dataTable({
                    "dom": 'T<"fg-toolbar ui-widget-header ui-corner-tl ui-corner-tr ui-helper-clearfix"lr>t<"fg-toolbar ui-widget-header ui-corner-bl ui-corner-br ui-helper-clearfix"ip>',
                    "TableTools": {
                        "Buttons": [
                            "print",
                            {
                                "Extends":    "collection",
                                "ButtonText": "Save",
                                "Buttons":    [ "csv", "xls", "pdf" ]
                            }
                        ]
                    }
                });
            }
        });

I'm using jquery 1.10.2, jquery-ui 1.11.2, datatables 1.10.4 and tabletools 2.2.3.

Thanks

Answers

  • ramtamtamramtamtam Posts: 4Questions: 2Answers: 0

    Figured it out. Have to put the script code to the sources/report_table_3.html

This discussion has been closed.