Can't update tbody in IE 6 with page['name'].replace_html

Can anyone verify that you can’t update a tbody element in IE 6 by using
page[‘name]’.replace_html?

I’ve tried all three ways I know to update the innerHTML property of the
tbody and it won’t take.

But page[‘name’].insert_html works fine.

Just look for corroboration.

Thanks,
Wes

Hi Wes,

Wes G. wrote:

Can anyone verify that you can’t update a tbody
element in IE 6 by using page[‘name]’.replace_html?

It’s true for all IE versions. IE uses MS Table DOM, not the W3C DOM.
There’s an explanation on MSDN. You can replace a tbody, you can insert
another tbody above or below, but you basically can’t do anything via
Ajax
with an existing

or . I think you can update a if that
does anything for you. Not 100% sure of all the caveats on that though.

hth,
Bill

I guess this was why I got that error with the Dojo FilteringTable on
IE.

Hi Wes,

Good info. Thanks! I’ll put this in the Save folder.

Best regards,
Bill

What I needed to do was to replace a whole set of rows (in a datagrid)
with another set.

Luckily, IE does follow DOM level 2 (at least for what I needed), and I
solved my problem by deleting each row from the bottom up (you have to
do it from the bottom up or the relative indexing of rows within the

element will change), and then doing a "page.insert_html" to the bottom of the tbody (which will at that point have no rows in it).

It is a pain in the arse, but it does work in both IE and FF.
XSLDatagrid::ROWS_TO_DISPLAY is the number of rows in the tbody named
xdgRowSet_thingy.

Here’s the code:

render :update do |page|
(0…XSLDatagrid::ROWS_TO_DISPLAY - 1).to_a.reverse.each do |index|
page <<
“$(‘xdgRowSet_#{XSLDatagrid::CONTAINER_ID}’).deleteRow(#{index});”
end
page.insert_html(:bottom, “xdgRowSet_#{XSLDatagrid::CONTAINER_ID}”,
output)

…other stuff…
end

I have such mixed feelings about this project, it causes me so much
grief but then I always end up learning something useful by overcoming
all these ridiculous f-in’ problems ;).

Wes