Datatables et fnReloadAjax
Bonjour.
Depuis plusieurs jours, je rencontre une erreur dans l'utilisation du plugin
Citation:
//cdn.datatables.net/plug-ins/f2c75b7247b/api/fnReloadAjax.js
que je ne comprends pas.
Ce plugin donne la possibilité de recharger de manière simple.
Dans un premier temps, je déclare ma Datatable et tout se passe bien.
Pour la recharger, j'utilise la fonction "fnClearTable()" puis "fnReloadAjax" et j'obtient systématiquement l'erreur ;
Citation:
Uncaught TypeError: oTable.fnClearTable is not a function
Je n'arrive pas à voir où est le problème, pourriez vous m'aider ?
Voici mon code :
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
| oTable=$('#table_liste_icl').DataTable( {
"processing" : true,
"serverSide" : true,
"paging" : false,
"oLanguage" : { "sProcessing" :"Traitement en cours...",
"sLengthMenu" :"Afficher _MENU_ éléments",
"sZeroRecords" :"Aucun élément à afficher",
"sInfo" :"Affichage de l'élement _START_ à _END_ sur _TOTAL_ éléments",
"sInfoEmpty" :"Affichage de l'élement 0 à 0 sur 0 éléments",
"sInfoFiltered" :"(filtré de _MAX_ éléments au total)",
"sInfoPostFix" :"",
"sSearch" :"Rechercher:",
"sUrl" :"",
"oPaginate" :
{
"sFirst" :"Premier",
"sPrevious" :"Précédent",
"sNext" :"Suivant",
"sLast" :"Dernier"
}
},
"ajax" : "php/listing.php?antenne_courante="+$("#antenneprox").val(),
"drawCallback" : function(settings)
{
CallBack(settings);
}
}); |
Code:
1 2 3 4 5 6 7 8 9 10 11 12
|
if ( $.fn.dataTable.isDataTable( '#table_liste_icl' ) )
{
console.log("*** *** *** dans le if *** *** ***\n");
oTable.fnClearTable();
oTable.fnReloadAjax("php/listing.php?antenne_courante="+$("#antenneprox").val());/**/
$("#table_liste_icl").fadeIn("slow");
var oSettings = $('#table_liste_icl').dataTable().fnSettings();
var iTotalRecords = oSettings.fnRecordsTotal();
console.log("*** *** *** iTotalRecords : "+iTotalRecords+"\n")
} |