Forum: Ruby on Rails Ready to call this a bug

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Bill W. (Guest)
on 2006-04-04 02:01
(Received via mailing list)
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=...

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
Sathish K. N (Guest)
on 2006-04-04 06:16
(Received via mailing list)
I remember reading on this forum that IE doesn't support DOM
manupulation of
tables.
Rob B. (Guest)
on 2006-04-04 18:46
(Received via mailing list)
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 B.		http://agileconsultingllc.com
removed_email_address@domain.invalid
+1 513-295-4739
Bill W. (Guest)
on 2006-04-04 20:00
(Received via mailing list)
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 B.
  To: removed_email_address@domain.invalid
  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 B. http://agileconsultingllc.com
  removed_email_address@domain.invalid
  +1 513-295-4739




  On Apr 3, 2006, at 10:14 PM, Sathish K. N wrote:


    I remember reading on this forum that IE doesn't support DOM
manupulation of tables.


    On 4/3/06, Bill W. <removed_email_address@domain.invalid> 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=...

      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
      removed_email_address@domain.invalid
      http://lists.rubyonrails.org/mailman/listinfo/rails





    _______________________________________________
    Rails mailing list
    removed_email_address@domain.invalid
    http://lists.rubyonrails.org/mailman/listinfo/rails




------------------------------------------------------------------------------


  _______________________________________________
  Rails mailing list
  removed_email_address@domain.invalid
  http://lists.rubyonrails.org/mailman/listinfo/rails
This topic is locked and can not be replied to.