Hidden columns shown during the loading

Hidden columns shown during the loading

simonpietrosimonpietro Posts: 1Questions: 0Answers: 0
edited March 2013 in General
Hi,

I am using datatables with hidden columns inside, and it works fine. I am populating the table through php code. The problem is that when I load the page, for a couple of seconds (the time to load the data), the table is shown with the hidden column and without the proper css.

Below there is my datatable code:

[code]
var myTable = $('#my_table').dataTable({
"bPaginate": false,
"bJQueryUI": true,
"bInfo": false,
"bFilter": false,
"bAutoWidth": false,
"aoColumns":
[
{ "bVisible": false},
null,
null,
null,
null,
null,
{ "bSortable": false },
null,
null,
{ "bSortable": false }
],
"aaSorting":
[
[0,'desc'],[4, 'asc'],[5, 'desc']
],
"fnRowCallback": function( nRow, aData, iDisplayIndex )
{
var tds = $(nRow).children();
$(tds[0]).removeClass();
$(tds[0]).addClass("l pad_left5 pointer size25 c"); // name
return nRow;
}
}); // dataTable
[/code]

Thank you very much

Replies

  • allanallan Posts: 63,522Questions: 1Answers: 10,473 Site admin
    Flash of unscripted content... If you are using a DOM data source, this is unavoidable (since the browser will try to draw the page when it is ready, and then run the Javascript). It will be different between the different browsers, but virtually impossible to fully eliminate, particularly if you are using a large table.

    You could consider using Ajax sourced data which of course doesn't have this issue.

    Allan
This discussion has been closed.