Thanks for your reply.

I guess this is more of a design question, but it has implications for performance.

I plan a JSON implementation where the server sends me data in a JSON object.
The Object will contain data destined for a single row of my client table. The data will contain information for 1 up to x name:value pairs for each possible column data for a single row.

In other words, the object can contain either just the necessary data for the update, or it can contain data for the entire row.

Since I can have an object in _javascript_ that can track the name:value translation, in terms of which cell to update, I'm thinking it's probably more efficient to pass around a
<tr id="xx"> to simplify tracking of the destination row to update. That way I won't care in which manner the data is sorted.

I don't think I'm the first to try this, so I'm seeking the wisdom of others who have. My server side scripts will be written in ruby. When I get this solved, I'll gladly place the source example here.

-- Steve

Michael Peters wrote:
s.d wrote:
  
I'm designing a table that is displayed in a client browser.
 
The columns are *sortable*. I'd like to be able to target (via AJAX) a
specific row (or even a specific cell within the row) to be updated when
I receive a status change from the server.

What is the best way to go about this? Should I have a separate <div
id="xxx"> for each row? Is there a better way?
    

I don't believe you can have a div be a direct child of a tr. Why not just give
the tr an id (probably the same as the record it corresponds to on the server
side), and then have your _javascript_ code select that tr when it needs to
update. Changing the order of that tr shouldn't change it's id right? You could
also give your td's class names based on the column (or an id that's a
combination or tr's id and column number like "2_5") if you wanted to
specifically target a td.

  


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to