On Nov 18, 2008, at 8:32 PM, RyOnLife wrote:

One note for future readers... Though it seems clear to me now, took
me a few minutes to realize that instead of trigger('edit'), use
trigger('click') or trigger('dblclick')—whatever event you use in your
editable()

For people not to get confused. You absolutely CAN use trigger('edit') or trigger('foobar') or trigger('whatever'). Clicking external link has to trigger the SAME event you used in Jeditable settings.

If you have

  $(".edit").editable("http://www.example.com/save.php";, {
      event     : "edit"
   });

use trigger('edit') in external link.

If you have

  $(".edit").editable("http://www.example.com/save.php";, {
      event     : "click"
   });

Use trigger('click') in external link.

And so on.


On Nov 10, 5:05 pm, Mika Tuupola <[EMAIL PROTECTED]> wrote:
On Nov 10, 2008, at 9:02 PM, RyOnLife wrote:

Hello, I am using Jeditable. Currently firing the plugin when the
editable div is double clicked. I'd also like to add a text link
outside of the editable div, and when clicked, it would make the div
editable. Just want to give my users a visual cue for those that
aren't yet aware of the ability to double click. Can someone let me
know how to do this? Thanks!

There are many ways to do it. But for example If your html is:

-cut-
   <div class="edit" id="unique_id">Editable text</div> <a href="#"
class="edit_trigger">Edit me!!</a>
-cut-

You could do something like:

-cut-
  $(".edit").editable("http://www.example.com/save.php";, {
      event     : "edit"
   });
   $(".edit_trigger").bind("click", function() {
       $(this).prev().trigger("edit");
   });
-cut-

--
Mika Tuupolahttp://www.appelsiini.net/

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

Reply via email to