I''ve been trying to get a handle on AJAX today and am ready to call "BUG!" I started with the code from Curt''s "AJAX on Rails". It used <ul="my_list"> and <li> and worked fine. Except I need a table instead of a list. So I did the simplest thing that I thought could possibly work. In the view, I changed the :position attribute from "top" to "after", the <ul> to <table>, <li> to <tr> and added a <td> to hold the text. In the controller, I changed the render_text argument from "<li>...</li>" to "<tr><td>...</td></tr>" In Firefox, it works great. Having loaded Firebug, I can see the HTML and I get exactly what I expect. Every time I enter something in the field and click the button I get a new <tr><td>text</td></tr> added to the table. In IE, nothing gets added to the table. I added the developer tool bar to IE and confirmed this. Nothing, not even something wrong, is getting added. I believe this may be related to the way IE handles things vis-a-vis DOM vs. their Table Object Model. They explain at http://msdn.microsoft.com/library/default.asp?url=/workshop/author/dhtml/reference/objects/tbody.asp I would really really appreciate it if someone much more knowledgeable than I would take a look and see if this is something I can work around and still use prototype, or if I''ve got to take some convoluted MS path to working with tables. Thanks in advance for any assistance. I''ll be happy to send the code if it would assist. Best regards, Bill -------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060403/05b7c5bf/attachment-0001.html
I remember reading on this forum that IE doesn''t support DOM manupulation of tables. On 4/3/06, Bill Walton <bill.walton@charter.net> wrote:> > I''ve been trying to get a handle on AJAX today and am ready to call > "BUG!" > > I started with the code from Curt''s "AJAX on Rails". It used > <ul="my_list"> and <li> and worked fine. Except I need a table instead of a > list. So I did the simplest thing that I thought could possibly work. > > In the view, I changed the :position attribute from "top" to "after", the > <ul> to <table>, <li> to <tr> and added a <td> to hold the text. In the > controller, I changed the render_text argument from "<li>...</li>" to > "<tr><td>...</td></tr>" > > In Firefox, it works great. Having loaded Firebug, I can see the HTML and > I get exactly what I expect. Every time I enter something in the field and > click the button I get a new <tr><td>text</td></tr> added to the table. > > In IE, nothing gets added to the table. I added the developer tool bar to > IE and confirmed this. Nothing, not even something wrong, is getting added. > > I believe this may be related to the way IE handles things vis-a-vis DOM > vs. their Table Object Model. They explain at > http://msdn.microsoft.com/library/default.asp?url=/workshop/author/dhtml/reference/objects/tbody.asp > > I would really really appreciate it if someone much more knowledgeable > than I would take a look and see if this is something I can work around and > still use prototype, or if I''ve got to take some convoluted MS path to > working with tables. > > Thanks in advance for any assistance. I''ll be happy to send the code if > it would assist. > > Best regards, > Bill > > > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails > > >-------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060404/36cf25c9/attachment.html
Well, I know that script.actulo.us/prototype can add rows to a <tbody> in IE. Try: <table> <tbody id="my_list"> <tr><td>...</td></tr> </tbody> </table> If you have ever wanted to use <th> in the "body" section of a table, but styled differently from the <th> in the "heading" section, then you should also use <thead> </thead> around the actual heading section (and, yes, <tfoot> for the footer which doesn''t have to be last either). -Rob Rob Biedenharn http://agileconsultingllc.com Rob@AgileConsultingLLC.com +1 513-295-4739 On Apr 3, 2006, at 10:14 PM, Sathish Kumar N wrote:> I remember reading on this forum that IE doesn''t support DOM > manupulation of tables. > > > On 4/3/06, Bill Walton <bill.walton@charter.net> wrote: > I''ve been trying to get a handle on AJAX today and am ready to call > "BUG!" > > I started with the code from Curt''s "AJAX on Rails". It used > <ul="my_list"> and <li> and worked fine. Except I need a table > instead of a list. So I did the simplest thing that I thought > could possibly work. > > In the view, I changed the :position attribute from "top" to > "after", the <ul> to <table>, <li> to <tr> and added a <td> to hold > the text. In the controller, I changed the render_text argument > from "<li>...</li>" to "<tr><td>...</td></tr>" > > In Firefox, it works great. Having loaded Firebug, I can see the > HTML and I get exactly what I expect. Every time I enter something > in the field and click the button I get a new <tr><td>text</td></ > tr> added to the table. > > In IE, nothing gets added to the table. I added the developer tool > bar to IE and confirmed this. Nothing, not even something wrong, > is getting added. > > I believe this may be related to the way IE handles things vis-a- > vis DOM vs. their Table Object Model. They explain at http:// > msdn.microsoft.com/library/default.asp?url=/workshop/author/dhtml/ > reference/objects/tbody.asp > > I would really really appreciate it if someone much more > knowledgeable than I would take a look and see if this is something > I can work around and still use prototype, or if I''ve got to take > some convoluted MS path to working with tables. > > Thanks in advance for any assistance. I''ll be happy to send the > code if it would assist. > > Best regards, > Bill > > > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails > > > > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails-------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060404/a118ff89/attachment.html
Hallelujah! Pass the chicken!!! Thanks, Rob. After spending time on the MS developer site reviewing their "How to create dynamic tables", I''d had the same thought and tried exactly that first thing this morning. Got no joy. Gave up, figuring MS had screwed me again. Your email got me back on it. Turned out I needed to change one more thing. In the form_remote_tag, I had to change :position => ''after'' to :position => ''bottom''. Many, many, many thanks. Expect public attribution for the help. Best regards, Bill ----- Original Message ----- From: Rob Biedenharn To: rails@lists.rubyonrails.org Sent: 2006-04-04 9:44 AM Subject: Re: [Rails] Ready to call this a bug Well, I know that script.actulo.us/prototype can add rows to a <tbody> in IE. Try: <table> <tbody id="my_list"> <tr><td>...</td></tr> </tbody> </table> If you have ever wanted to use <th> in the "body" section of a table, but styled differently from the <th> in the "heading" section, then you should also use <thead> </thead> around the actual heading section (and, yes, <tfoot> for the footer which doesn''t have to be last either). -Rob Rob Biedenharn http://agileconsultingllc.com Rob@AgileConsultingLLC.com +1 513-295-4739 On Apr 3, 2006, at 10:14 PM, Sathish Kumar N wrote: I remember reading on this forum that IE doesn''t support DOM manupulation of tables. On 4/3/06, Bill Walton <bill.walton@charter.net> wrote: I''ve been trying to get a handle on AJAX today and am ready to call "BUG!" I started with the code from Curt''s "AJAX on Rails". It used <ul="my_list"> and <li> and worked fine. Except I need a table instead of a list. So I did the simplest thing that I thought could possibly work. In the view, I changed the :position attribute from "top" to "after", the <ul> to <table>, <li> to <tr> and added a <td> to hold the text. In the controller, I changed the render_text argument from "<li>...</li>" to "<tr><td>...</td></tr>" In Firefox, it works great. Having loaded Firebug, I can see the HTML and I get exactly what I expect. Every time I enter something in the field and click the button I get a new <tr><td>text</td></tr> added to the table. In IE, nothing gets added to the table. I added the developer tool bar to IE and confirmed this. Nothing, not even something wrong, is getting added. I believe this may be related to the way IE handles things vis-a-vis DOM vs. their Table Object Model. They explain at http://msdn.microsoft.com/library/default.asp?url=/workshop/author/dhtml/reference/objects/tbody.asp I would really really appreciate it if someone much more knowledgeable than I would take a look and see if this is something I can work around and still use prototype, or if I''ve got to take some convoluted MS path to working with tables. Thanks in advance for any assistance. I''ll be happy to send the code if it would assist. Best regards, Bill _______________________________________________ Rails mailing list Rails@lists.rubyonrails.org http://lists.rubyonrails.org/mailman/listinfo/rails _______________________________________________ Rails mailing list Rails@lists.rubyonrails.org http://lists.rubyonrails.org/mailman/listinfo/rails ------------------------------------------------------------------------------ _______________________________________________ Rails mailing list Rails@lists.rubyonrails.org http://lists.rubyonrails.org/mailman/listinfo/rails -------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060404/9eb5387c/attachment-0001.html