Buttons doesn't appearing

Buttons doesn't appearing

gmsettagmsetta Posts: 7Questions: 2Answers: 0

Here's the code:

$(document).ready(function () {
        var table = $('#example').DataTable({   
            buttons: [
                'copy', 'excel', 'pdf', 'print'
            ],      
            "lengthMenu": [[5, 10, 25, 50, -1], [5, 10, 25, 50, "Tudo"]],
            "language": {
                "url": "js/datatables_Portuguese-Brasil.json"
            },
            "data": testdata.data,
            select:"single",
            "columns": [
                 {
                     "className": 'details-control',
                     "orderable": false,
                     "data": null,
                     "defaultContent": '',
                     "render": function () {
                         return '<i class="fa fa-plus-circle" aria-hidden="true"></i>';
                     },
                     width:"15px"
                 },
                 { "data": "nome" },
                 { "data": "cargo" },
                 { "data": "linha" },
                 { "data": "modelo" },
                 { "data": "ativo" }
             ],
            dom: 'Bfrtip',          
             "order": [[1, 'asc']]
         });

This question has an accepted answers - jump to answer

Answers

  • gmsettagmsetta Posts: 7Questions: 2Answers: 0

    In fact, only "Print" button is showing.

  • kthorngrenkthorngren Posts: 20,309Questions: 26Answers: 4,769
    Answer ✓

    Sounds like you are loading all the required libraries for the other buttons. Start with the Bultin Buttons doc then click the link of each button like excelHtml5 to see the requirements for each button.

    Even easier is to use the Download Builder to obtain the correct libraries for the buttons you want.

    Kevin

  • gmsettagmsetta Posts: 7Questions: 2Answers: 0

    I wasn't loading all the JS needed! Thks!

This discussion has been closed.