to flicker or not to flicker

to flicker or not to flicker

degenarodegenaro Posts: 24Questions: 1Answers: 0
edited September 2012 in DataTables 1.9
My code is called on a timer (30 seconds) to update a monitor page stared at by users, and looks like this:

[code]
function load_data()
{
oTable.fnClearTable();
oTable.fnReloadAjax();
}
[/code]

Each 30 seconds, the table flickers. The flicker seems to disappear if I remove the fnClearTable() call. What's the downside to removing?

Thanks.

Lou.

Replies

  • allanallan Posts: 63,395Questions: 1Answers: 10,451 Site admin
    edited September 2012
    Don't call fnClearTable first - fnReloadAjax will do it for you once its got the data form the server. Otherwise you have the period while the new data is being loaded with an empty table - which results in the flicker.

    *Edit* - Didn't read the last line :-). So there is no downside. Have a look at the fnReloadAjax code - it calls fnClearTable.

    Allan
This discussion has been closed.