I have jeditable fields that are updated by AJAX, so I use .live () in conjunction with Jeditable to be able to constantly bind jeditable fields after updating AJAX. However, using live (), it suppresses the first 'click', and this is the second click that makes the field editable.
It is interesting (and perhaps the key to the solution) if I use 'this' as a link, the first click is suppressed for each individual field of the jedtxt class (i.e., double-click to enter the Jedtxt field, and then double to enter edit for field B jedtxt), but if I use the class name . Jedtxt ' , the first click will only be suppressed once (it takes 2 clicks to enter field A, but after field B can be entered with one click - the first click on the class appears to “remember”.
Using $ (this) Suppresses the first click every time an element of the jedtxt class:
$('.jedtxt').live('click', function() {
$(this).editable('/post/somewhere',{
'submit': 'OK',});});
Using $ ('. Jedtxt') Suppresses the first click only the first time . The jedtxt class is clicked:
$('.jedtxt').live('click', function() {
$('.jedtxt').editable('/post/somewhere',{
'submit': 'OK',});});
And the jedtxt elements are like:
<div id="ni-50" name="ni-50" class="jedtxt">somevalue to edit</div>
, , . . , . - , div.
.