How to best replace all table data?

How to best replace all table data?

fogcityfogcity Posts: 7Questions: 0Answers: 0
edited September 2010 in General
I'm building an iPad web application. The key there is to eliminate page reloads. So, my (large) table is initially built from the html file, but when necessary the table is completely reloaded with (a lot of) new data.

It's important to note that my header row usually changes each time the table data is replaced. However the table remains the same size and usually with the same number of rows and columns.

Right now, I am purging my datatable and then calling the constructor again, as follows:

[code]oTable.fnDestroy();
oTable = $('#datatable').dataTable();[/code]

I am wondering however, is there a quicker or more memory-efficient way of doing this?

I see dataTable functions that allow individual rows to be removed or inserted, but again I am always replacing all of the table data.

Can't I just purge the cached table data and have my dataTable simple re-initialize itself from the new data?
This discussion has been closed.