Quantcast
Channel: Recent Discussions — DataTables forums
Viewing all articles
Browse latest Browse all 82001

Buttons are not working anymore

$
0
0

Hello there !

I'm trying to update dynamically an already initialized datatable (with some export and print buttons, with a searchbar). These functionnalities are working perfectly at first.
However, I have to replace data from my table, thanks to a script included in an iframe.

So, I think that I had to create another draw of this datatable.

Here's the code:
`

        dataTableProd = $('#myTable');

        dataTableProd.DataTable({
            "destroy": true,
            "ordering": false,
            "paging": false,
            "language": {
              "url": "/orders/js/french.json"
            },
            "initComplete": function() {
                // Just made some worthless stuff
            },
            dom: "Bfrtip",
            buttons: [
              { extend: "excel", text: "Export Excel", className: "btnExportExcel" },
              { extend: "pdf", text: "Export PDF" },
              { extend: "print", text: "Imprimer", exportOptions: 
                {
                  columns: ':visible',
                    stripHtml: false
                }
              }
            ]
        });

        dataTableProd.DataTable().draw();

`

This new structure is displayed perfectly. I checked the searchbar update about new data included in my table and I find it.
But the last functionnalities that doesn't work are the updated buttons, which apparently lost some listeners from "dataTables.buttons.min.js" script, even if I put it in the iframe page.

Can I have an alternative to call actions despite this problem with a custom listener on theses buttons, or should I make this listener back to fix it ?

Thanks in advance for your reply.


Viewing all articles
Browse latest Browse all 82001

Trending Articles