replacing table rows with ajax
I have a table that I would like to replace table rows in via ajax. I am using other table plugins so keeping the all the classes intact for the columns and rows is important. I have it now where I can add rows to the table via ajax no problem.
I take the id of each DB result and give it to each row. From a subsequent ajax call I would like to take the updated record and replace the existing table row. The ajax destination page is php and currently it simply returns the formatted html TR rows, then I do a table prepend to add that html.
How can I accomplish the replacing? Should I have my ajax page return a javascript array instead or something similar? I suppose I can delete the row from the table and add the updated one back, but I'm not sure how to accomplish that looping.