On Jul 31, 2007, at 1:41 AM, Josh Nathanson wrote:

Mark - you might be able to nudge the jEditable creator to mod the plugin to allow for a "remote" activator. Or, if you're feeling adventurous you could do it yourself. It would be a fairly signifcant mod however, since the code always refers to both the event target and the returned form as "this".

Why make a mod when jQuery itself can handle it :)

First bind jEditable to some event. For example doubleclick. Then make the clicked "remote" link to cause doubleclick on edited element. For example something like:

$(document).ready(function() {
    $(".editable").editable("http://www.example.com/save.php";, {
        event  : 'dblclick',
        type   : 'textarea',
        submit : 'OK'
    });
    $(".editable_link").bind('click', function() {
        $(this).prev().dblclick();
    });
});

You have to adjust above to suit your html. Workind demo at:

http://www.appelsiini.net/~tuupola/jquery/jeditable/markg85.php

--
Mika Tuupola                      http://www.appelsiini.net/~tuupola/



Reply via email to