<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type"> </head> <body bgcolor="#ffffff" text="#000000"> <font face="Arial">I''m designing a table that is displayed in a client browser.<br> <br> 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.<br> <br> 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?<br> <br> How else should I track here the updated information needs to be displayed, as the sortable table may have last been sorted by any column header prior to the latest update?<br> <br> I realize that if I maintain the "xx" id, that I should be able to update only that specific row, especially if the div "xx" id is one of the JSON parameters I pass back from the server.<br> <br> All opinions and suggestions are appreciated.<br> <br> -- Steve<br> <br> <br> </font> <br> --~--~---------~--~----~------------~-------~--~----~<br> You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. <br> To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org <br> To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org <br> For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en <br> -~----------~----~----~----~------~----~------~--~---<br> </body> </html> <br>
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. -- Michael Peters Developer Plus Three, LP --~--~---------~--~----~------------~-------~--~----~ 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 rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type"> </head> <body bgcolor="#ffffff" text="#000000"> Thanks for your reply.<br> <br> I guess this is more of a design question, but it has implications for performance.<br> <br> I plan a JSON implementation where the server sends me data in a JSON object.<br> 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.<br> <br> In other words, the object can contain either just the necessary data for the update, or it can contain data for the entire row.<br> <br> 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 <br> <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.<br> <br> 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.<br> <br> -- Steve<br> <br> Michael Peters wrote: <blockquote cite="mid4670436D.30500-aUYv5hkjw45l57MIdRCFDg@public.gmane.org" type="cite"> <pre wrap="">s.d wrote: </pre> <blockquote type="cite"> <pre wrap="">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? </pre> </blockquote> <pre wrap=""><!----> 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. </pre> </blockquote> <br> <br> --~--~---------~--~----~------------~-------~--~----~<br> You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. <br> To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org <br> To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org <br> For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en <br> -~----------~----~----~----~------~----~------~--~---<br> </body> </html> <br>
Reasonably Related Threads
- sortable - after complete dropping element want to send ajax reqeust with id of elements: draggable and droppable
- Sortable: Ajax not firing?
- Sortable list with Ajax and delete function - working example
- Ajax.PeriodicalUpdater using Effect.Highlight to highlight newly loaded div
- Sortable + Table = Ouch!