l-lin / angular-datatables

DataTables with Angular
https://l-lin.github.io/angular-datatables/
MIT License
1.57k stars 486 forks source link

dtOptions: DataTables.Settings - ignored #1628

Closed giuseppemorale closed 2 years ago

giuseppemorale commented 2 years ago

:beetle: bug report

DataTables Options not working. Tried to change Language (and others) with DataTables.Settings, it doesn't work

:microscope: Minimal Reproduction

StackBlitz/GitHub Link:

Step-by-step Instructions:

:8ball: Expected behavior

Language Datatable Italian

:camera: Screenshots

I've created a service to manage DataTables (i've also tried in component)

service

ngOnInit in component:

ngOnInit

Table Result:

dataTable

Html:

component-html

:globe_with_meridians: Your Environment

:memo: Additional context

CODE PASSED TO SETTINGS:


public tableOptions: DataTables.Settings =  {
        pagingType: 'full_numbers',
        pageLength: 10,
        language: {
            emptyTable: "Nessun dato presente nella tabella",
            info: "Vista da _START_ a _END_ di _TOTAL_ elementi",
            infoEmpty: "Vista da 0 a 0 di 0 elementi",
            infoFiltered: "(filtrati da _MAX_ elementi totali)",
            infoPostFix: "",
            lengthMenu: "Visualizza _MENU_ elementi",
            loadingRecords: "Caricamento...",
            processing: "",
            search: "Cerca:",
            zeroRecords: "La ricerca non ha portato alcun risultato.",
            paginate: {
                first: "Inizio",
                previous: "Precedente",
                next: "Successivo",
                last: "Fine"
            },
            aria: {
                sortAscending: ": attiva per ordinare la colonna in ordine crescente",
                sortDescending: ": attiva per ordinare la colonna in ordine decrescente"
            }
      }
}