Commit f92d527b authored by Mat's avatar Mat

Peuple le tableau à partir du json

parent 21fffaab
......@@ -45,10 +45,10 @@
<a href="javascript: void(0);" class="btn-sort">#</a>
</th>
<th scope="col">
<a href="javascript: void(0);" class="btn-sort">Nom</a>
<a href="javascript: void(0);" class="btn-sort">Prénom</a>
</th>
<th scope="col">
<a href="javascript: void(0);" class="btn-sort">Prenom</a>
<a href="javascript: void(0);" class="btn-sort">Nom</a>
</th>
<th scope="col">
<a href="javascript: void(0);" class="btn-sort">Email</a>
......@@ -82,11 +82,37 @@
tbody.innerHTML = null;
AJAX('GET', membreURL, function(request)
{
tr = document.createElement('tr');
td1 = document.createElement('td');
td1.textContent = 'hop';
tr.appendChild(td1);
tbody.appendChild(tr);
let json = JSON.parse(request.responseText);
for (var i = 0; i < json.length; i++) {
tr = document.createElement('tr');
td1 = document.createElement('td');
td1.textContent = json[i].id;
tr.appendChild(td1);
td2 = document.createElement('td');
td2.textContent = json[i].prenom;
tr.appendChild(td2);
td3 = document.createElement('td');
td3.textContent = json[i].nom;
tr.appendChild(td3);
td4 = document.createElement('td');
td4.textContent = json[i].email;
tr.appendChild(td4);
td5 = document.createElement('td');
td5.textContent = json[i].association.nom;
tr.appendChild(td5);
td6 = document.createElement('td');
td6.textContent = 'Editer - Supprimer';
tr.appendChild(td6);
tbody.appendChild(tr);
}
});
}
reloadTableMembre();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment