Row details with sql request
Row details with sql request
I use datatables with show extra / detailed information
In the fonction format(d), I have include this code to use request asynchrone script
'<tr>'+
'<td>Extra info:</td>'+
'<td>'+asynchrone_tri(d.id)+'</td>'+
'</tr>'+
and this is my asynchrone fonction
function asynchrone_tri(id) {
var data = null;
// Instanciation grâce au browser
getXhr();
// On ouvre une requêtre asynchrone : 'true'
xhr.open('POST', '../thumbails/thumbails0.php', true);
// Fonction appelée quand la requête change d'état
xhr.onreadystatechange = function() {
// Si la requête est terminée
if (xhr.readyState == 4)
// Si la réponse ne contient pas d'erreur
if (xhr.status == 200) {
alert(xhr.responseText);
return xhr.responseText;
} //else
// Erreur
//document.getElementById("liste_agences").innerHTML = 'Erreur serveur !';
}
xhr.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
// On envoie la requête
// n=document.getElementById("n").value;
data = "idplanches=" + id + "&reportvisible=true";
xhr.send(data);
}
But in my table, I have a "undifined" value in the td.
Can you help me, please?
Answers
It is ok for me.
Thank you
Hello,
Please, could you tell me how did you solve this problem?
DataTables doesn't have to use all of the data that is given to it in the displayed columns. So you can just include the extra information in a JSON property that is not displayed in a column.
Allan
Thank you Allan