Quantcast
Channel: Recent Discussions — DataTables forums
Viewing all articles
Browse latest Browse all 81687

odd issue: displaying table twice (briefly the first time)

$
0
0
Using DataTables 1.9.4 with jQuery 1.8.2:
I've searched the forums but can't find a solution to this issue.
When the page loads, I first see the full result set (all rows), briefly, then the DataTable displays only the 10 rows correctly. This page has a lot of columns (30). Why the brief display of all records? Anyone have any ideas on why this happens?

Unfortunately, the page is on a secure site, so I can't share a link here, but I can share part of the document ready function. One caveat, my columns are dynamically generated ahead of the document ready javascript, which is the PHP variable ($aocolumns) you see below.
Part of document ready function:
// start snippet:
var oTable = $('#maintable').dataTable( {
"aaSorting": [[ 0, "asc" ]],
"aoColumns": [
{ "sType": "num-html" },
{ "bSortable": false },
{ "bSortable": false },
{ "bSortable": false },
{ "bSortable": false },
<?= $aocolumns;?>
],
"aLengthMenu": [[5, 10, 25, 50, -1], [5, 10, 25, 50, "All"]],
"bStateSave": true, // save state? not really...we have to use localstorage
"fnStateSave": function(oSettings, oData) { save_dt_view(oSettings, oData); }, // required! This saves the state to localstorage
"fnStateLoad": function(oSettings) { return load_dt_view(oSettings); }, // required! This loads the state from localstorage
"sPaginationType": "full_numbers",
"iDisplayLength": 10,
"iCookieDuration": 60*60*48 // 2 days
} );
new FixedHeader( oTable ); // create floating header in Datatable
oTable.fnFilterClear(); // Reset/Remove all filtering on page load
// end snippet

Viewing all articles
Browse latest Browse all 81687

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>