TableTools buttons not working properly

TableTools buttons not working properly

pablofariapablofaria Posts: 4Questions: 1Answers: 0

I am trying to use TableTools and everything seems to be fine except that when I click on any of the buttons Copy/PDF/CSV/Excel the buttom become light blue and its text get underlined, but nothing happens. I tried all the tips that I could find on the internet: changing z-index of DTTT_button class, trying both a local and the DataTables CDN link for the SWF file and changing Flash security settings.

I can't provide a link or create a fiddle for it, because its a password protected context. But, in sum, the HTML table is created dynamically (for a database query) and the DataTables activation is also done dynamically.

DataTables debug link: http://debug.datatables.net/iyekut

But, still, no luck. Does somebody have any other idea?

Answers

  • pablofariapablofaria Posts: 4Questions: 1Answers: 0
    edited November 2014

    Well, I still don't know what the problem is, but I just got things working by adding an explicit "aButtons" entry to TableTools initialization:

      "aButtons": [ 
        "copy",
        {
            "sExtends": "print",
            "sButtonText": "<?php echo _('Imprimir'); ?>",
            "sToolTip": "<?php _echo('Visualizar impressão'); ?>"
        },
        { "sExtends": "collection",
          "sButtonText": "Save",
          "aButtons": [
            {
                "sExtends": "csv",
                "sButtonText": "CSV",
                "sToolTip": "<?php _echo('Salvar em formato CSV'); ?>",
                "mColumns": "visible"
            },
            {
                "sExtends": "xls",
                "sButtonText": "Excel",
                "sToolTip": "<?php _echo('Salvar como lista de valores separados por tabulação'); ?>",
                "mColumns": "visible"
            },
            {
                "sExtends": "pdf",
                "sButtonText": "PDF",
                "sToolTip": "<?php _echo('Salvar como arquivo PDF'); ?>",
                "sPdfOrientation": "landscape",
                "mColumns": "visible"
            }
          ]
        }
      ]
    

    Before that I was just initializing it as:

    "sDom": 'T<"clear">lfrtip',
    "oTableTools": {
      "sSwfPath": "http://cdn.datatables.net/tabletools/2.2.2/swf/copy_csv_xls_pdf.swf" }
    

    Hope that it helps somebody.

  • pablofariapablofaria Posts: 4Questions: 1Answers: 0

    Another observation: I had to put all buttons inside the collection button in order for them to work properly. I noticed that if I click any button AFTER clicking a collection button, they work; otherwise, they don't. What does it mean?

This discussion has been closed.