# AJAX/RJS Updating of Table Rows

**URL:** <https://www.ruby-forum.com/t/ajax-rjs-updating-of-table-rows/58310>\
**Category:** Rails\
**Created:** [April 20, 2006, 2:40pm UTC](https://www.ruby-forum.com/t/ajax-rjs-updating-of-table-rows/58310 "2006-04-20T14:40:28Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![nicholas-henry](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/bcef8e/32.png) [@nicholas-henry](https://www.ruby-forum.com/u/nicholas-henry)\
**Post date:** [April 20, 2006, 2:40pm UTC](https://www.ruby-forum.com/t/ajax-rjs-updating-of-table-rows/58310/1 "2006-04-20T14:40:28Z")

</div>

I’m trying to update a table row (i.e. replace a

) using  
AJAX/RJS but of course this cannot be done in IE (works fine in  
Firefox). I have googled but have not found any solutions, only a lot  
of discussion. Does anyone have a solution to this problem?

Cheers,  
Nicholas

---

<div class="post-metadata">

**Author:** ![nicholas-henry](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/bcef8e/32.png) [@nicholas-henry](https://www.ruby-forum.com/u/nicholas-henry)\
**Post date:** [April 20, 2006, 3:02pm UTC](https://www.ruby-forum.com/t/ajax-rjs-updating-of-table-rows/58310/2 "2006-04-20T15:02:06Z")

</div>

maybe you can replace your table with a css-based layout? table-layouts  
are  
kind of legacy old-stuff anyway…

or maybe that:

updated content here

---

<div class="post-metadata">

**Author:** ![nicholas-henry](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/bcef8e/32.png) [@nicholas-henry](https://www.ruby-forum.com/u/nicholas-henry)\
**Post date:** [April 20, 2006, 3:14pm UTC](https://www.ruby-forum.com/t/ajax-rjs-updating-of-table-rows/58310/3 "2006-04-20T15:14:29Z")

</div>

Thanks, Peter – but I’m using tables for a legimate purpose, tabular  
data; i.e. I’m not using for layout. I don’t think

 is valid markup.

Cheers,  
Nicholas

---

<div class="post-metadata">

**Author:** ![nicholas-henry](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/bcef8e/32.png) [@nicholas-henry](https://www.ruby-forum.com/u/nicholas-henry)\
**Post date:** [April 20, 2006, 3:26pm UTC](https://www.ruby-forum.com/t/ajax-rjs-updating-of-table-rows/58310/4 "2006-04-20T15:26:44Z")

</div>

No, but

 is.

If you assign an id to the td you can’t use it in the update?  
Haven’t tried this myself, but I’m surprised that it wouldn’t work.

\<% link\_to\_remote “Change it!”, :url =\> {blah blah}, :update =\>  
‘the\_row’ %\>

-Derrick S.

---

<div class="post-metadata">

**Author:** ![nicholas-henry](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/bcef8e/32.png) [@nicholas-henry](https://www.ruby-forum.com/u/nicholas-henry)\
**Post date:** [April 20, 2006, 3:32pm UTC](https://www.ruby-forum.com/t/ajax-rjs-updating-of-table-rows/58310/5 "2006-04-20T15:32:50Z")

</div>

Thank you for your help everybody, I will check out these solutions as  
well. I have also found this:

[http://www.larrygoats.com/articles/2006/01/26/taconite-prototype-rails](http://www.larrygoats.com/articles/2006/01/26/taconite-prototype-rails)

I dropped his script it and it fixed my problem right away.

Cheers,  
Nicholas

---

<div class="post-metadata">

**Author:** ![nicholas-henry](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/bcef8e/32.png) [@nicholas-henry](https://www.ruby-forum.com/u/nicholas-henry)\
**Post date:** [April 20, 2006, 3:32pm UTC](https://www.ruby-forum.com/t/ajax-rjs-updating-of-table-rows/58310/6 "2006-04-20T15:32:51Z")

</div>

Thank you for your help everybody, I will check out these solutions as  
well. I have also found this:

[http://www.larrygoats.com/articles/2006/01/26/taconite-prototype-rails](http://www.larrygoats.com/articles/2006/01/26/taconite-prototype-rails)

I dropped his script it and it fixed my problem right away.

Cheers,  
Nicholas

---

<div class="post-metadata">

**Author:** ![nicholas-henry](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/bcef8e/32.png) [@nicholas-henry](https://www.ruby-forum.com/u/nicholas-henry)\
**Post date:** [April 20, 2006, 3:17pm UTC](https://www.ruby-forum.com/t/ajax-rjs-updating-of-table-rows/58310/7 "2006-04-20T15:17:36Z")

</div>

On 4/20/06, Nicholas H. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> I’m trying to update a table row (i.e. replace a ) using  
> AJAX/RJS but of course this cannot be done in IE (works fine in  
> Firefox). I have googled but have not found any solutions, only a lot  
> of discussion. Does anyone have a solution to this problem?

Take a look at Richard W.'s Ajax Scaffold Generator:  
[http://www.ajaxscaffold.com/](http://www.ajaxscaffold.com/)

It uses RJS to update table rows and is “Guaranteed to work on Firefox  
1+, IE 6+ and Safari 10+”. I think his solution is something like  
remove the original row, insert the updated row, and move it into the  
original row’s position.

---

<div class="post-metadata">

**Author:** ![nicholas-henry](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/bcef8e/32.png) [@nicholas-henry](https://www.ruby-forum.com/u/nicholas-henry)\
**Post date:** [April 20, 2006, 5:05pm UTC](https://www.ruby-forum.com/t/ajax-rjs-updating-of-table-rows/58310/8 "2006-04-20T17:05:28Z")

</div>

Sorry for the late reply, but I wrote an article that sort of deals with  
this, and then some:

> **[unspace.ca](http://unspace.ca/discover/datagrid/)**
>
> This domain may be for sale!

Good luck!  
Pete

----- Original Message -----  
From: “Nicholas H.” [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
To: [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
Sent: Thursday, April 20, 2006 8:37 AM  
Subject: [Rails] AJAX/RJS Updating of Table Rows

I’m trying to update a table row (i.e. replace a ) using  
AJAX/RJS but of course this cannot be done in IE (works fine in  
Firefox). I have googled but have not found any solutions, only a lot  
of discussion. Does anyone have a solution to this problem?

Cheers,  
Nicholas

* * *

Rails mailing list  
removed\_email\_address@domain.invalid  
[http://lists.rubyonrails.org/mailman/listinfo/rails](http://lists.rubyonrails.org/mailman/listinfo/rails)
