Thanks Walter.
I tried that already and found the editor to be essentially disabled (you
could click but not get the form).
On Jan 27, 2013 6:14 PM, "Walter Lee Davis" <[email protected]> wrote:
>
> On Jan 27, 2013, at 4:10 PM, Phil Petree wrote:
>
> > Hi All!
> >
> > I'm implementing the scriptaculous inplace editor and I have it working
> except for one small detail:
> >
> > If I activate the editor, click cancel, activate the editor again I get
> two inplace editors. cancel those and activate again and I get three.
> cancel those and activate again and I get four... and on and on and on...
> >
> > What's the trick to this? Here's my code:
> >
> > html:
> > <tr><td onclick='editName(this, id)'>Homer Simpson</td></tr>
> >
> > javascript:
> > function editName(element, id)
> > {
> > new Ajax.InPlaceEditor(element, 'name_inpl_ajax.php', {
> > okText: " Save ",
> > cancelControl: "button",
> > callback: function(form, value) {
> > return 'id=' +id + '&name='+encodeURIComponent(value)
> > }
> > });
> > }
> >
>
> This editor isn't behaving as documented lately, I had an occasion to
> upgrade a working editor to the latest versions of Prototype and
> Scriptaculous, and found that clicking to edit the second time would cause
> the editor to load the editing form itself for editing. Not a good time for
> my client!
>
> You might want to look at this option:
>
> > Removing the behavior
> > To disable the InPlaceEditor behavior later on, store it in a variable
> like:
> >
> > var editor = new Ajax.InPlaceEditor('product_1'
> > ,...);
> > (...
> > do
> > stuff ..)
> > editor.dispose();
> >
> > This way, you can enable and disable " In Place Editing ":
> http://madrobby.github.com/scriptaculous/in-place-editing at will.
> >
>
> See if that can work around the issue for you.
>
> Walter
>
> --
> You received this message because you are subscribed to the Google Groups
> "Prototype & script.aculo.us" group.
> To post to this group, send email to
> [email protected].
> To unsubscribe from this group, send email to
> [email protected].
> Visit this group at
> http://groups.google.com/group/prototype-scriptaculous?hl=en.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>
--
You received this message because you are subscribed to the Google Groups
"Prototype & script.aculo.us" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
Visit this group at
http://groups.google.com/group/prototype-scriptaculous?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.