I want to integrate the translator plug in and export to excel

I want to integrate the translator plug in and export to excel

meramera Posts: 1Questions: 1Answers: 0
$(document).ready(function() {
var table = $('#tabla1').DataTable({
    lengthChange: false,
    buttons: [ 'copy', 'excel', 'pdf', 'colvis' ],
    "columnDefs": [
        { "orderable": false, "targets": 7 },
        { "orderable": false, "targets": 8 },
        { "orderable": false, "targets": 9 },
        { "orderable": false, "targets": 10 },
        ],

    "pageLength":100,
});
table.buttons().container()
    .appendTo( '#tabla1_wrapper .col-md-6:eq(0)' );
});

I want to integrate the translator plug in

$(document).ready(function() {
    $('#tabla1').DataTable({
   "language": {"url": '/datatable/Spanish.json'},
});

the 2 work separately but I can't add "language": {"url": '/datatable/Spanish.json'}, to the first example

Answers

  • kthorngrenkthorngren Posts: 13,799Questions: 25Answers: 3,246

    Move the language option on line 3 into the datatable init code in the first snippet.

    Kevin

Sign In or Register to comment.