Note that there are some explanatory texts on larger screens.

plurals
  1. POJeditable + Sortable + Cloning
    primarykey
    data
    text
    <p>I've researched this question pretty thoroughly, but so far I haven't been able to solve it. I understand about clone(true,true) and making the functions live(), but events are still getting misfired. </p> <p>Here is my example - <a href="http://jsfiddle.net/vAfMf/2/" rel="nofollow">http://jsfiddle.net/vAfMf/2/</a> -- click the + sign, and then try clicking on the cloned element to trigger Jeditable.</p> <p>Here's the relevant code:</p> <pre><code>var fixHelper = function(e, ui) { ui.children().each(function() { $(this).width($(this).width()); }); return ui; }; $(".tracklist").sortable({ placeholder: "track-highlight", helper: fixHelper, items: "tr", start: function(event, ui) { i=0; notdragged = false; thisthing = $(this); }, stop: function(event, ui) { notdragged = true; }, revert: true, update: function(event, ui) { $(".tracklist .numcol").each(function(){ $(this).html(""); }); $(".tracklist .numcol").each(function(){ i++ $(this).html(i+".&amp;nbsp;&amp;nbsp;"); }); } }); $(".eachtrack").editable("save.php", { select : true, style : "display: inline", width : "95%", cancel : "&lt;button class=\'cancelthistrack\'&gt;Cancel&lt;\/button&gt;", submit : "&lt;button class=\'savethis\'&gt;Save&lt;\/button&gt;", event : "custom_event" }); $(".tracklist tr td .eachtrack").live("mousedown", function() { notdragged = true; }).live("mouseup", function() { if (notdragged) { $(this).trigger("custom_event"); $(this).parent().css("height", "auto"); } }); $(".artistcol,.infocol,.titlecol").live("mousedown", function() { notdragged = true; }).live("mouseup", function() { if (notdragged) { $(this).children(".eachtrack").trigger("custom_event"); } }); $(".tracklist tr .btnwrap .addt_outer .addt_inner .addt .pngfix").click(function(){ var thisrow = $(this).parent().parent().parent().parent().parent(); var newrow = thisrow.clone(true,true); newrow.insertAfter(thisrow); return false; }); </code></pre> <p>Basically I'm having the exact same problem as <a href="http://old.nabble.com/jEditable-Clone-Referring-to-the-Original-Element-td19574439s27240.html" rel="nofollow">this poster here</a> -- when I clone the Jeditable element, clicking on the clone opens the original element and not the clone. While the question is answered as to what to do -- rebinding events -- no example is shown as to how to do it, and I am at a loss. My example is complicated by the fact that I have a few functions in place to prevent the Jeditable triggering when the Sortable has completed.</p> <p>Any help as to how to unbind the original element's events and rebind then to the clone would be greatly appreciated.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload