Hi, how would I replace a complete table row including the <tr>...</tr> tags with Ajax/DHTML ? The :update parameter to remote_function() takes the ID of a HTML element, but can replace only the innerHTML part, i.e. the stuff between <tr> and </tr>, but not the <tr> tag itself (required to change its parameters). regards --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Thorsten Mueller
2008-May-28 10:06 UTC
Re: Ajax/DHTML: How to replace a <tr>...</tr> in a table?
don''t use the :update param then, just call your ajax action and tell the browser which tag to replace by it''s id (requires unique id for each table row) something like: page["tr_002"].replace_html("<tr>new content</tr>") should work -- 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Frederick Cheung
2008-May-28 10:10 UTC
Re: Ajax/DHTML: How to replace a <tr>...</tr> in a table?
On 28 May 2008, at 10:52, Hadmut wrote:> > Hi, > > how would I replace a complete table row including the <tr>...</tr> > tags with Ajax/DHTML ? > > The :update parameter to remote_function() takes the ID of a HTML > element, but can replace only the innerHTML part, i.e. the stuff > between <tr> and </tr>, but not the <tr> tag itself (required to > change its parameters).Perhaps the obvious solution is to not use :update; just write some js that will use Element.replace instead of Element.update Fred --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
> how would I replace a complete table row including the <tr>...</tr> > tags with Ajax/DHTML ?I thought IE could not replace a table row. Maybe I misremember some restriction there... --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Rob Biedenharn
2008-May-28 16:24 UTC
Re: Ajax/DHTML: How to replace a <tr>...</tr> in a table?
On May 28, 2008, at 7:36 AM, Phlip wrote:>> how would I replace a complete table row including the <tr>...</tr> >> tags with Ajax/DHTML ? > > I thought IE could not replace a table row. Maybe I misremember some > restriction > there...Do you have <tbody> ... </tbody> tags surrounding your rows? If you have trouble, that might be some of it. -Rob Rob Biedenharn http://agileconsultingllc.com Rob-xa9cJyRlE0mWcWVYNo9pwxS2lgjeYSpx@public.gmane.org --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
On May 28, 12:06 pm, Thorsten Mueller <rails-mailing-l...@andreas- s.net> wrote:> something like: > > page["tr_002"].replace_html("<tr>new content</tr>") > > should workGood point, but the docs say that replace_html replaces the inner part only, not the element. regards --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
On May 28, 12:10 pm, Frederick Cheung <frederick.che...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Perhaps the obvious solution is to not use :update; just write some js > that will use Element.replace instead of Element.updateThat way looks good, but how exactly would I call this? I guess the best way would be to call it from :success, but how could I get the HTML fragment passed by the server then? regards --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
>> page["tr_002"].replace_html("<tr>new content</tr>") >> >> should work> Good point, but the docs say that replace_html replaces the inner > part only, not the element.Then use .replace Tips: put an ID into your TR, such as tr_002, so the system knows what to replace. And put the TR into a partial, so you can use .replace :tr_002, :partial => ... --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Frederick Cheung
2008-May-29 08:44 UTC
Re: Ajax/DHTML: How to replace a <tr>...</tr> in a table?
On 28 May 2008, at 23:37, Hadmut wrote:> > > > On May 28, 12:10 pm, Frederick Cheung <frederick.che...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> > wrote: > >> Perhaps the obvious solution is to not use :update; just write some >> js >> that will use Element.replace instead of Element.update > > > That way looks good, but how exactly would I call this? > > I guess the best way would be to call it from :success, but how could > I get the HTML fragment passed by the server then? >Your success function gets passed the response object, so response.responseText contains whatever the controller generated. You might find it less hassle to go with Phlip''s suggestion. Fred> regards > > >--~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Firstname Secondname
2008-May-29 10:20 UTC
Re: Ajax/DHTML: How to replace a <tr>...</tr> in a table?
Phlip wrote:>> how would I replace a complete table row including the <tr>...</tr> >> tags with Ajax/DHTML ? > > I thought IE could not replace a table row. Maybe I misremember some > restriction > there...That''s right, it''s not possible to replace tr in IE. Replace table. -- 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
IE has its own proprietary way of modifying table rows and cells (it''s possible-- http://msdn.microsoft.com/en-us/library/ms532998(VS.85).aspx), but I don''t think Prototype uses it. Last time I checked it can successfully remove rows for IE, -tieg On May 29, 6:20 am, Firstname Secondname <rails-mailing-l...@andreas- s.net> wrote:> Phlip wrote: > >> how would I replace a complete table row including the <tr>...</tr> > >> tags with Ajax/DHTML ? > > > I thought IE could not replace a table row. Maybe I misremember some > > restriction > > there... > > That''s right, it''s not possible to replace tr in IE. > > Replace table. > -- > Posted viahttp://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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---