Bonjour à tous,
Voici mon souci, j'ai une fonction qui se déclenche au clic sur une case à coché (par exemple)
Ce clic permet de mettre à jours une table à l'aide d'une fonction Ajax
Mon problème est que si je clic plusieurs fois rapidement sur la case, dès fois la table double ou triple son résultat, elle n'a pas le temps de se vider...

Voici ma fonction :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
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
31
32
33
34
35
36
37
38
 
function modif_table_stagiaire(client_id) {
 
	$("#modalCheck5").prop("checked",true);
 
	$('#table_stagiaire').html("<tr id='tr_1'><th class='supr' colspan=\"3\" style=\"min-width:75px\">Action </th><th rel='nom'>Nom</th><th rel='prenom'>Prénom</th></tr>");
	if(client_id < 1){//Quant il arrive ou change de page on vide la table
		 $('#table_stagiaire').append('<tr><td colspan="5" style="text-align:center">Sélectionnez un client pour afficher ses salariés</td></tr>');	
	}
 
	 $.ajax({
        dataType: "json",
        type: "GET",
        url: chemin_complet+'ajax/creer_table_stagiaire.php,
 
        success: function(msg){
			if(msg['erreur'] == undefined){//Signifie qu'il n'y est pas d'erreur
				for (c in msg)
				{
					if(c >= 0){
 
						$('#table_stagiaire').append('<tr  id="'+msg[c].id+'" rel="'+c+'"  style="cursor:pointer">'+
						'<td style=\"padding-left:10px\" ><center><img class="commentaire" rel="'+c+'" alt="Commentaire" title="Ajouter un commentaire à ce client" src="'+img_commentaire+'"/></td>'+
						'<td style=\"padding-left:10px\" class="supr"><center><img class="delete" rel="'+msg[c].id+'" alt="Supr" title="Supprimer ce contact" src="js/table/img/suppr.png"/></td>'+
						'<td style=\"padding-right:10px;padding-left:10px;text-align:center\" class="supr"><img class="modification" rel="'+c+'" alt="Modif" title="Modifier ce client" src="js/table/img/modif_client.png"/></td>'+
						'<td>'+msg[c].nom+'</td>'+
						'<td>'+msg[c].prenom+'</td></tr>');
					}
					$("#modalCheck5").prop("checked",false);
				}
 
			}else{
				$().toastmessage('showWarningToast', "Problème d'identification du client");
				$("#modalCheck5").prop("checked",false);
			}
		}
	});	
}
Cela $("#modalCheck5").prop("checked",true); permet d'afficher un loader et $("#modalCheck5").prop("checked",false); de la cacher le loader prend tout le body mais même avec ça j'ai le souci...

Merci d'avance à tous