Thank you but somewhat I cannot figure out where exactly I should put it in.
Would you mind to point out in the DataTable example where I should add such bit of code ?
I struggle with this as I tried in the updateTable function, in the loadTable one, as an other function which I call in the initComplete, but I never get the expected results…
I put this in Global in the DataTable example code declared as Javascript
NSB.MsgBox(“Essaye d’écrire”);
$(“#DataTable1”).DataTable( {
“language”: {
“lengthMenu”: “Affiche MENU éléments par page”,
“zeroRecords”: “Désolé pas de résultat”,
“info”: “Affiche page PAGE parmi PAGES”,
“infoEmpty”: “Pas d’enregistrement trouvé”,
“infoFiltered”: “(filtrés sur on total de MAX total enregistrements)”
}
}
);
and I get the following message
DataTables warning: table id=DataTable1 - Cannot reinitialise DataTable. For more information about this error, please see 3. Warning: Cannot reinitialise DataTable
and the Datatable doesn’t load
The page describes that a DataTable cannot be made twice, but none of the examples provided works, whether I try retrieve, destroy etc…I always get the same warning.
How is it possible to add this code at the right place, where the Datatable is first declared. ( This is what I was trying to do when putting the code in update or other functions…)
I’m not sure if this will help, but here’s a function I’ve used to completely remove a table (so it can be recreated). It’s in JavaScript.
destroyTable(table) {
if (!$.fn.DataTable.isDataTable(`#${table}`)) return;
$(`#${table}`).DataTable().destroy(); // remove table
$(`#${table}`).empty(); // this needs to be here - completely cleanup the table
$(`#${table}`).off('click', 'td'); // need to kill event listener
},
Thanks for the hint, but I’m still struggling with probably a more down the earth issue:
I’ve seen in previous discussions that despite options not being shown if the toolbox, they seemed to be accessible (If I’m right this was dealing with initComplete before release ??):
How is this done and where in the flow of creating the DataTable ?
There doesn’t seem to be an example on this…
Thank you, but is there a way to define options that are not in the toolbox: eg “language” ?
in the datatable environment one has
$(“#idtable”).DataTable ( {
language : {
“sSearch”: “Rechercher :”,
“sLengthMenu”: “Afficher MENU éléments”,
“sInfo”: “Affichage de l’élément START à END sur TOTAL éléments”,
“sInfoEmpty”: “Affichage de l’élément 0 à 0 sur 0 élément”, }
});
DataTables1.settings.language = {
"sSearch": "Rechercher :",
"sLengthMenu": "Afficher MENU éléments",
"sInfo": "Affichage de l’élément START à END sur TOTAL éléments",
"sInfoEmpty": "Affichage de l’élément 0 à 0 sur 0 élément",
};