Skip to content

Instantly share code, notes, and snippets.

@moxet
Created June 21, 2022 14:27
Show Gist options
  • Save moxet/3c3eb83dee1d9e95bfa4bf045e554467 to your computer and use it in GitHub Desktop.
Save moxet/3c3eb83dee1d9e95bfa4bf045e554467 to your computer and use it in GitHub Desktop.
Crocoblock JetTable Builder Export to CSV, PDF, Excel
<link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/v/dt/dt-1.11.2/datatables.min.css"/>
<script type="text/javascript" src="https://code.jquery.com/jquery-3.5.1.js"></script>
<script type="text/javascript" src="https://cdn.datatables.net/1.12.1/js/jquery.dataTables.min.js"></script>
<script type="text/javascript" src="https://cdn.datatables.net/buttons/2.2.3/js/dataTables.buttons.min.js"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jszip/3.1.3/jszip.min.js"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.1.53/pdfmake.min.js"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.1.53/vfs_fonts.js"></script>
<script type="text/javascript" src="https://cdn.datatables.net/buttons/2.2.3/js/buttons.html5.min.js"></script>
<script type="text/javascript" src="https://cdn.datatables.net/buttons/2.2.3/js/buttons.print.min.js"></script>
<script>
jQuery(document).ready(function($) {
$('.jet-dynamic-table').DataTable( {
dom: 'Bfrtip',
buttons: [
'copy', 'csv', 'excel', 'pdf', 'print'
]
} );
});
</script>
@JuanCar29
Copy link

Muchas gracias por el código, como se puede hacer que solo se muestre los botones de exportar, copiar , pdf, excell y print?

@moxet
Copy link
Author

moxet commented Apr 21, 2024

Muchas gracias por el código, como se puede hacer que solo se muestre los botones de exportar, copiar , pdf, excell y print?

<script> 
jQuery(document).ready(function($) { 
    $('.jet-dynamic-table').DataTable( {
        dom: 'Bfrtip',
        buttons: [
            'copy', 'excel', 'pdf'
        ]
    } );
}); 
</script>

@JuanCar29
Copy link

Thank you very much for answering.

I have explained myself poorly. What I want is for only the buttons to be shown, the pagination, search and sorting not to be shown.

@moxet
Copy link
Author

moxet commented Apr 27, 2024

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment