Updating a tr with RJS

I’m having a strange display issue when trying to update a tablerow
using RJS.

This is the code in the RJS template:

page.replace_html “item_#{@item.id}”, :partial => ‘item_display’

So the existing

has an id like item_1. When the update actions
completes, it renders this template and effectively replaces the tr with
item_display which as a tr of its own. The issue is, the new row doesn’t
span the width of the table.

Has anyone encountered this before?

Thanks.

Most/all browsers don’t have any support for DOM manipulation of tables.
Not sure why, its a real pity. You’ll need to come up with a hack for
it. I think the ajaxscaffold.com solution includes some code that works
with table dom manipulation.

Make sure you enclose your TRs in a TBODY tag.

Zack

Zack,

That does help for not getting the IE error, but still when updating a
row by replacing it with a partial, doesn’t render it correctly.

Thanks.

Zack C. wrote:

Make sure you enclose your TRs in a TBODY tag.

Zack

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs