I have an RJS template that does the following page.insert_html :bottom, "some_id", ''<tr id="some_id"><td></td></tr>'' This works just find in safari and firefox. In IE and Opera it doesn''t work so great. Any ideas? Am I doing something wrong here? -- Posted via http://www.ruby-forum.com/.
Ben, Had this problem and it took me hours. It uses the prototype insert method, and it doesn''t work when trying to insert into tables. To get it to work you have to use a tbody tag instead of a table. page.insert_html :bottom, "tbody_id", ''<tr id="some_id"><td></td></tr>'' <tbody id="tbody_id"> <tr>my row</tr> -----Original Message----- From: rails-bounces@lists.rubyonrails.org [mailto:rails-bounces@lists.rubyonrails.org] On Behalf Of Ben Johnson Sent: Wednesday, 2 August 2006 12:37 PM To: rails@lists.rubyonrails.org Subject: [Rails] RJS not cross browser compatible? I have an RJS template that does the following page.insert_html :bottom, "some_id", ''<tr id="some_id"><td></td></tr>'' This works just find in safari and firefox. In IE and Opera it doesn''t work so great. Any ideas? Am I doing something wrong here? -- Posted via http://www.ruby-forum.com/. _______________________________________________ Rails mailing list Rails@lists.rubyonrails.org http://lists.rubyonrails.org/mailman/listinfo/rails
On 8/1/06, Ben Johnson <bjohnson@mediamanifest.com> wrote:> I have an RJS template that does the following > page.insert_html :bottom, "some_id", ''<tr id="some_id"><td></td></tr>''''some_id'' probably shouldn''t be the target of your insertion _and_ also the id of the inserted element. You need the id of the <table> here for your target. page.insert_html :bottom, ''table_id'', ''<tr id="some_id"><td></td></tr>''> This works just find in safari and firefox. In IE and Opera it doesn''t > work so great. Any ideas? Am I doing something wrong here?Manually adding <tbody> tags seems to help. -- Greg Donald http://destiney.com/
Ben Johnson wrote:> I have an RJS template that does the following > > page.insert_html :bottom, "some_id", ''<tr id="some_id"><td></td></tr>'' > > This works just find in safari and firefox. In IE and Opera it doesn''t > work so great. Any ideas? Am I doing something wrong here?That might be because IE can only insert tr elements in a <tbody>, and not in a <table>. Try adding a <tbody id="some_id"> tag. -- Posted via http://www.ruby-forum.com/.
Sander Land wrote:> Ben Johnson wrote: >> I have an RJS template that does the following >> >> page.insert_html :bottom, "some_id", ''<tr id="some_id"><td></td></tr>'' >> >> This works just find in safari and firefox. In IE and Opera it doesn''t >> work so great. Any ideas? Am I doing something wrong here? > > That might be because IE can only insert tr elements in a <tbody>, and > not in a <table>. > Try adding a <tbody id="some_id"> tag.Thanks for the help. It seems as though firefox can''t insert into tbody tags. I guess it''s a lose lose situation unless someone has another suggestion. -- Posted via http://www.ruby-forum.com/.
On Aug 2, 2006, at 2:38 AM, Ben Johnson wrote:> Sander Land wrote: >> Ben Johnson wrote: >>> I have an RJS template that does the following >>> >>> page.insert_html :bottom, "some_id", ''<tr id="some_id"><td></td></ >>> tr>'' >>> >>> This works just find in safari and firefox. In IE and Opera it >>> doesn''t >>> work so great. Any ideas? Am I doing something wrong here? >> >> That might be because IE can only insert tr elements in a <tbody>, >> and >> not in a <table>. >> Try adding a <tbody id="some_id"> tag. > > Thanks for the help. > > It seems as though firefox can''t insert into tbody tags. I guess > it''s a > lose lose situation unless someone has another suggestion. >Ben- Try it like this, it works for IE, firefox and safarti: With your table, ensure that you have the proper <tbody> tag around all <tr> elements. Have the links within each of the TR''s that should display the info below have an id like so <table> <tbody> <tr> <td> <table> <tbody id="row1"> <tr> <td></td> <td>link for info with id...</td> <td>link for info with id...</td> </tr> </tbody> </table> </td> </tr> <tr> <td> <table> <tbody id="row2"> <tr> <td></td> <td>link for info with id...</td> <td>link for info with id...</td> </tr> </tbody> </table> </td> </tr> </tbody> </table> And you should be able to use RJS like so... page.insert_html :bottom, params[:row], render(:partial => ''rowHelpInfo'') Cheers- -Ezra
> > It seems as though firefox can''t insert into tbody tags. I guess it''s a > lose lose situation unless someone has another suggestion.we just avoid using tables for layout and use <div> exclusively.. another option you might be able to use though is a <ul> ? -- Posted via http://www.ruby-forum.com/.
Brez! !! wrote:> >> >> It seems as though firefox can''t insert into tbody tags. I guess it''s a >> lose lose situation unless someone has another suggestion. > > > we just avoid using tables for layout and use <div> exclusively.. > another option you might be able to use though is a <ul> ?The reason I''m using a table is because the data is tabular data. We need to be able to have everything organized in columns etc. Oh well, no big deal. -- Posted via http://www.ruby-forum.com/.
Ben Johnson wrote:>> Ben Johnson wrote: > It seems as though firefox can''t insert into tbody tags. I guess it''s a > lose lose situation unless someone has another suggestion.This: <body onload=''new Insertion.Bottom("some_id", "<tr><td>cell</td></tr>")''> <table border=1><tbody id=''some_id''></tbody></table> </body> works for me in both IE and firefox. Are you sure the tbody is the only element with some_id ? -- Posted via http://www.ruby-forum.com/.
Sander Land wrote:> Ben Johnson wrote: >>> Ben Johnson wrote: >> It seems as though firefox can''t insert into tbody tags. I guess it''s a >> lose lose situation unless someone has another suggestion. > > This: > > <body onload=''new Insertion.Bottom("some_id", > "<tr><td>cell</td></tr>")''> > <table border=1><tbody id=''some_id''></tbody></table> > </body> > > works for me in both IE and firefox. > Are you sure the tbody is the only element with some_id ?Yes, I just viewed the source and did a find for the id and it only found one instance of the id. It might have something to do with my layout. I''m not sure. -- Posted via http://www.ruby-forum.com/.