Dear all, First I''d like to thank authors for so nice Scriptaculous and Prototype libraries, which helped me already a lot! I have question regarding externalControl parameter in InPlaceEditor. If I understand correctly, I can use that to have one image as a trigger to enter edit mode? I tried with below code but without success: <span id="id1">My text</span> <script type="text/javascript"> new Ajax.InPlaceEditor(''id1'', ''/object/o2499548.html?ajaxRequest&ajaxInPlaceEditing'', {externalControl:''id2''}) </script> <img id="id2" src="/img/buttonEdit.gif"> Thanks Janko
Move the id2 tag above the script tag. That needs to be loaded before giving a call to it. The following should work. <span id="id1">My text</span> <img id="id2" src="/img/buttonEdit.gif"> <script type="text/javascript"> new Ajax.InPlaceEditor(''id1'', ''/object/o2499548.html?ajaxRequest&ajaxInPlaceEditing'', {externalControl:''id2''}) </script> Thank you, Mandy.
Hi Mandy, I alreaady put image before text element, also without success (This is easier to do in my framework than to put between text and script). Do I really need to put image in between? <img id="id2" src="/img/buttonEdit.gif"> <span id="id1">My text</span> <script type="text/javascript"> new Ajax.InPlaceEditor(''id1'', ''/object/o2499548.html?ajaxRequest&ajaxInPlaceEditing'', {externalControl:''id2''}) </script> Maninder, Singh wrote:> Move the id2 tag above the script tag. > > That needs to be loaded before giving a call to it. > > The following should work. > > <span id="id1">My text</span> > <img id="id2" src="/img/buttonEdit.gif"> > <script type="text/javascript"> > new Ajax.InPlaceEditor(''id1'', > ''/object/o2499548.html?ajaxRequest&ajaxInPlaceEditing'', > {externalControl:''id2''}) > </script> > > Thank you, > Mandy. > _______________________________________________ > Rails-spinoffs mailing list > Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs >-- Janko Mivšek Svetovalec za informatiko EraNova d.o.o. Ljubljana, Slovenija www.eranova.si tel: 01 514 22 55 faks: 01 514 22 56 gsm: 031 674 565
Mandy, I found answer by myself. Image can be also before text element. Reason not to work was my mistake in code. So rule is that external control must be before script. Thanks for your help! Janko Janko Mivšek wrote:> Hi Mandy, > > I alreaady put image before text element, also without success (This is > easier to do in my framework than to put between text and script). Do I > really need to put image in between? > > <img id="id2" src="/img/buttonEdit.gif"> > <span id="id1">My text</span> > <script type="text/javascript"> > new Ajax.InPlaceEditor(''id1'', > ''/object/o2499548.html?ajaxRequest&ajaxInPlaceEditing'', > {externalControl:''id2''}) > </script> > > > > Maninder, Singh wrote: > >> Move the id2 tag above the script tag. >> >> That needs to be loaded before giving a call to it. >> >> The following should work. >> >> <span id="id1">My text</span> >> <img id="id2" src="/img/buttonEdit.gif"> >> <script type="text/javascript"> >> new Ajax.InPlaceEditor(''id1'', >> ''/object/o2499548.html?ajaxRequest&ajaxInPlaceEditing'', >> {externalControl:''id2''}) >> </script> >> >> Thank you, >> Mandy. >> _______________________________________________ >> Rails-spinoffs mailing list >> Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org >> http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs >> >-- Janko Mivšek Svetovalec za informatiko EraNova d.o.o. Ljubljana, Slovenija www.eranova.si tel: 01 514 22 55 faks: 01 514 22 56 gsm: 031 674 565