problem with buttons and layout with tabletools library

problem with buttons and layout with tabletools library

dthemesdthemes Posts: 11Questions: 6Answers: 0

Hi,

I tried to use table tools library but I have an issue. Buttons is not showing up and also the layout is incorrect. I want the button to be on top on search box.

Please see the capture below :
http://picpaste.com/domo-asH7pSu1.png

Version:
- DataTable 1.10.6
- TableTools 2.2.4
- Jquery 1.11.1

    <script type="text/javascript" src="js/jquery.min.js"></script>
    <script type="text/javascript" src="js/jquery.dataTables.min.js"></script>
    <script type="text/javascript" src="js/dataTables.tableTools.js"></script>

    $.getJSON("http://" + SERVER + "/ldata/log", function( data ) {
      $(document).ready(function() {
        $('#log').html( '<table class="display compact" id="log-data" width="100%"></table>' );

        $('#log-data').dataTable( {
          "sDom": 'T<"clear">lfrtip',
          "tableTools": {
            "sSwfPath" : "http://cdn.datatables.net/tabletools/2.2.2/swf/copy_csv_xls_pdf.swf"
          },
          "data": data['tbody'],
          "columns": data['thead'],
          "lengthMenu":[[25,200,500,-1],[25,200,500,"All"]],
    });
       });
      });

Is something wrong with the code ? (surely yes...)

Answers

  • zodiacszodiacs Posts: 10Questions: 1Answers: 0

    Hi,

    You can putt the diffrent elements in Div's and then style with css.

    You can try this :

    "dom": '<"tblContainerT"T><"tblContainerTop"lf><rt><"bottom"ip>',
    

    and then in your css :

    .tblContainerTop {
        clear: both;
        margin-bottom: 35px;
    }
    

    This worked for me. Hope it helps you.

    Yves

  • dthemesdthemes Posts: 11Questions: 6Answers: 0

    Hi,

    Thank you for your answer but unfortunately its not working. That's strange because even the button are not taking into account SWF file (from the CDN). :(

  • dthemesdthemes Posts: 11Questions: 6Answers: 0

    Hmm...url image expired here a new one :
    http://picpaste.com/domo-6vuuOWdO.png

  • zodiacszodiacs Posts: 10Questions: 1Answers: 0
    edited May 2015

    Hi,

    Have you inserted the tableTools css file?

    http://cdn.datatables.net/#TableTools

    .....
    <link rel="stylesheet" type="text/css" href="<your path>/dataTables.tableTools.min.css">
    .....
    

    Can you post a test case? Without that help is very difficult.

    Yves

  • dthemesdthemes Posts: 11Questions: 6Answers: 0

    Hi Zodiacs,

    Sorry to not showing up more source code. I just took a look to dataTables.tableTools.min.css file and effectively I forgot it.

    I added it and everything is working fine.

    Thank you

This discussion has been closed.