Bonjour,
J'ai pris un code jQuery permettant de rendre un tableau html editable, mais plusieurs questions ce posent.
Tout d'abord voici le code :
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
| function ondblclick(boite){
boite.unbind("dblclick");
contenu = boite.text();
cle = boite.attr("cle");
boite.html('<input id="edition" type="text" cle="'+cle+'" value="'+contenu+'">');
$("#edition").focus();
$("#edition").blur(function(){
$.post("post_ajax.php",{cle: cle,val: $(this).val()},function(txt){
//alert(txt);
});
boite.text($(this).val());
boite.bind("dblclick",function(){ondblclick($(this))})
});
};
$(document).ready(function() {
$('td').bind("dblclick",function(){ondblclick($(this))});
}); |
Premier problème, lorsque je double clique, la cellule triple de taille, comment faire pour que la case d’édition n'agrandisse pas la cellule?
Et ensuite au niveau de l'envoi des données dans une BDD,je ne vois pas trop a quoi correspond la ligne :
$.post("post_ajax.php",{cle: cle,val: $(this).val()},function(txt){
Partager