DataTables logo DataTables

via Ad Packs
Can't get the [CSV, Save, PDF] etc. buttons to display when theming with twitter bootstrap
  • Have this in my javascript tabeltools initialization
    $(document).ready(function() {
              $('#countstable').dataTable( {
                "sDom": "<'row'<'span6'l><'span6'f>r>t<'row'<'span6'i><'span6'p>>",
                "sPaginationType": "bootstrap",
                "oLanguage": {
                  "sLengthMenu": "_MENU_ records per page"
                },
                "aaSorting":[[0, "desc"]],
                "iDisplayLength": 10,
                "oTableTools": {
                      "sSwfPath": "swf/copy_csv_xls_pdf.swf",
                      "aButtons": [
                        "copy",
                        "print",
                        {
                          "sExtends":    "collection",
                          "sButtonText": 'Save <span class="caret" />',
                          "aButtons":    [ "csv", "xls", "pdf" ]
                        }
                      ]
                    }
              } );
            } );
    

    I have verified that the path to swf file is correct because it worked with jQuery theme. I got the buttons to display then, but since I switched to bootstrap theme, I can't get the buttons to display.

    I followed the example on this page http://datatables.net/release-datatables/extras/TableTools/bootstrap.html and included the necessary datatables.bootstrap.js and datatables.bootstrap.css files. The table looks like it is in the example here http://datatables.net/blog/Twitter_Bootstrap_2.
  • allanallan
    Posts: 15,845
    Can you link us to the page with the problem please - that looks fine.

    Allan
  • Allan, I PMd you
  • Isn't he missing the T in sDom to display Tabletools?

    "sDom": "<'row-fluid'<'span6'T><'span6'f>r>t<'row-fluid'<'span6'i><'span6'p>>",

    The T in the first span6 class.

    Scott
  • allanallan
    Posts: 15,845
    Hi Scott,

    Eagle eyes! Yes you are absolutely correct - the issue is simply not initialising TableTools :-)

    Allan
This discussion has been closed.
← All Discussions

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Support

Get useful and friendly help straight from the source.

In this Discussion