On Dec 5, 2:50 pm, Scrooge <[EMAIL PROTECTED]> wrote:
> Hello,
>
> I have a simple problem for somebody who already dealed with it, but
> still after trying for several days, no solution yet:
>
> I want to use Ajax.Updater to dynamically update single rows of a
> table. Furthermore I want to use Ajax.Updater to add new rows to the
> table. What I currently do is using a <tbody id=xxx> statement as an
> ajax result container for each row. I am not sure if this is a clean
> solution but it works. Altough I have a lot of tbody tags per table it
> seems the only possible container to which I can direct an ajax result
> like "<tr><td>...</td></tr>"
>
> I can use the same container (<tbody id=xxx></tbody>) to add new rows
> to a table. But as soon as I want to change these newly added rows, I
> have the problem that there may be several new rows in this one
> container and I can not change a single row. I tried to let the ajax
> result for new rows add another <tbody id=xxx2> tag (which would be
> inside the first <tbody id=xxx> tag) and that does not work. You can
> not open several tbody tags at once.
>
> As there are many Ajax applications that use rows, there must be a
> solution to this. I am just not sure if there is a way to use
> ajax.updater for this. Please help.
>
The HTML specification says that a table has one or more tbody
elements, each of which contains one or more tr elements. You can't
nest a tbody in a tbody, or a tr in a tr.

So, if you need to add a row, you can either add it to an existing
tbody, or add a new tbody (containing it) to the table.
But if you need to replace one row in a tbody,
*either* you can work on the tbody, in which case you will have to
remove the existing tr and insert the new one yourself,
*or* you operate on the tr, and update its contents (with a list of th/
td elements, not with a tr).

What I would do is to make sure that each row (including each added
row) has a unique id, and then use Ajax.Updater(<id of row>, ... )
and make sure the updating code in this case is a list of cells, not a
tr.

Colin fine

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Prototype & script.aculo.us" group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to