I wrote some codes to generate a input field with auto complete functionality, these codes work well in a regular form, the codes are: ========================================================<INPUT id="vc_container_no" size="8" type="text" /> <div class=''auto_complete'' id=''vc_container_no_auto_complete'' style=''display:none;border:none;background-color:white;height:150px;overflow:none;cellpadding:0;cellspacing:0''> </div> <%= auto_complete_field( "vc_container_no", :frequency => 0.01, :min_chars => 2, :url=>{:action=>''autocomplete_vc_cno'', :cno=>''OO''}, :tokens => '','') %> ======================================================== However, when I use the same codes inside a :partial and render them with a collection, the input field still there, but the auto complete function no longer exist. At first I was suspecting that the problem come from the duplicate IDs of the <INPUT> and the <DIV> after rendering the collection, so I add a unique no. after the IDs, but it stills doesn''t work. I have worked on this problem the whole week but can not find solution, anyone have some idea about that? or has a sucessful experience of rendering :partial with auto_complete_field inside? Thanks in advance. Ieong -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Mc Ieong wrote:> I wrote some codes to generate a input field with auto complete > functionality, these codes work well in a regular form, the codes are:What about showing us the not working code? In particular the partial and the render :partial => ???, collection => ... Regards, T. -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
T. N. T. wrote:> Mc Ieong wrote: >> I wrote some codes to generate a input field with auto complete >> functionality, these codes work well in a regular form, the codes are: > > What about showing us the not working code? In particular the partial > and the > > render :partial => ???, collection => ... > > Regards, T.index.html.erb: ============== <div id="voyage_containers_div"> <%= render(:partial => "voyage_container", :collection => @voyage_containers) %> </div> _voyage_container: ================= <% @vc = voyage_container %> <div> <table class="subform_table"> <tr class="subform_tr" > <td valign="top" class="subform_td" id=''d1''> <INPUT id="vc_container_no" size="8" type="text" /> <div class=''auto_complete'' id=''vc_container_no_auto_complete'' style=''display:none;border:none;background-color:white;height:150px;overflow:none;cellpadding:0;cellspacing:0''> </div> <%= auto_complete_field( "vc_container_no", :frequency => 0.01, :min_chars => 2, :url=>{:action=>''autocomplete_vc_cno'', :cno=>''OO''}, :tokens => '','') %> </td> ... ... the auto_complete_field generate: ================================ <script type="text/javascript"> //<![CDATA[ var vc_container_no_auto_completer = new Ajax.Autocompleter(''vc_container_no'', ''vc_container_no_auto_complete'', ''/daily_voyages/update/autocomplete_vc_cno?cno=OO'', {frequency:0.01, minChars:2, tokens:'',''}) //]]> </script> Sorry, the codes are ugly, as I am very new to Ror.. -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Mc Ieong wrote: Anyone has success experience on rendering partial with auto_complete insided ?? -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Mc Ieong wrote: Anyone has success experience on rendering partial with auto_complete insided ?? -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Filip Moens
2010-Feb-07 21:41 UTC
Re: Problem in rendering :partial with auto_complete_field
Mc Ieong wrote:> Mc Ieong wrote: > > Anyone has success experience on rendering partial with auto_complete > insided ??Are you using Ruby 1.9.1? I have the same problem when using 1.9.1 but not with 1.8.6 which works as it is supposed to. -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.