Re: [jquery-omaha] Jeditable - Edit In Place Plugin For jQuery

From: user 1.
Sent on: Monday, November 8, 2010 1:41 PM
Interesting plugin.  I did something similar for editable start and end 
date links not too long ago.  It's not nearly as robust, but it's a 
minimal amount of code that accomplishes roughly the same thing.  I'm 
only using it for two links, otherwise I would have used a class as the 
jQuery selector.  It didn't really seem to be "plugin worthy" for our 
purposes, although I can see the benefit of using the plugin you linked 
if this type of functionality is common within your application.

                     $('#start-date-link,­ 
#end-date-link').cli­ck(function(e){
                       var target = e.target,
                           id = target.id,
                           value = $(target).text(),
                           textbox = $('<input type="text" id="'+id+'" 
value="'+value+'">­');

                       var originalLink = $(target).clone(true­);

                       $(target).replaceWit­h(textbox);
                       textbox.focus();

                       textbox.change(funct­ion(e){ //fires first because 
it's bound first
                         var hiddenField = $('#' + id.replace('-link','­')),
                             newValue = $(this).val();

                         hiddenField.val(newV­alue);
                         originalLink.text($(­this).val());
                       });

                       textbox.blur(functio­n(){
                         $(this).replaceWith(­originalLink);
                       });

                       return false;
                     });

On 11/8/[masked]:58 PM, Jay Hannah wrote:
> Whoah, neat:
>
>     http://www.appels...­
>
> This appears to be a perfect match for the client project I'm working on. Easy to get running, too.  :)
>
> Jay Hannah
> Software Architect
> [address removed] | http://mutationgr...­ |[masked]
>
>
>
>
>
>
>
> --
> Please Note: If you hit "REPLY", your message will be sent to everyone on this mailing list ([address removed])
> http://www.meetup...­
> This message was sent by Jay Hannah ([address removed]) from jQuery.
> To learn more about Jay Hannah, visit his/her member profile: http://www.meetup...­
> To unsubscribe or to update your mailing list settings, click here: http://www.meetup...­
> Meetup, PO Box 4668 #37895 New York, New York[masked] | [address removed]
>
>    


People in this
Meetup are also in:

Sign up

Meetup members, Log in

By clicking "Sign up" or "Sign up using Facebook", you confirm that you accept our Terms of Service & Privacy Policy