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 28 29 30
| $.ajax({
url : 'getdata.php',
type : 'GET'
})
.done(function(result) {
submitForm('ModifEleve'); // Récupération du formalisme du tableau en bdd, <th><td>...
StringJSON = JSON.parse(result); // Parsing du JSON
$("#table") // Utilisation d'un petit plugin JQUERY <a href="https://gist.github.com/buu700/4200601" target="_blank">https://gist.github.com/buu700/4200601</a>
.waitUntilExists(function() {
for (i = 0; i < StringJSON.length; i++) { // For each occurence in JSON
$("#table") // Création dynamique + ajou
.append(
'<tr><td contenteditable="true">'
+ StringJSON[i].NOMELEVE
+ '</td><td contenteditable="true">'
+ StringJSON[i].IDCOURSE
+ '</td><td contenteditable="true">'
+ StringJSON[i].ANNEENAISSANCE
+ '</td><td contenteditable="true">'
+ StringJSON[i].ADRESSE
+ '</td><td>'
+ '<input type="checkbox" name="certificat_'+i+'" id="certificat_'+i+'" >'
+ '</td><td contenteditable="true">'
+ StringJSON[i].AUTORISATIONP
+ '</td><td class="button validation" onclick="CheckModification">Valider</td><br><td class="button validation" onclick="DeleteEleve">supprimer</td></tr>'
);
}
});
});
return; |