slow dataTable and how to speed up !
slow dataTable and how to speed up !
kingSulaiman
Posts: 3Questions: 2Answers: 0
Hi, I'm using server side dataTable ,I have 20,000 row/data, when I load with pagination its take time 3m 3s as i saw in console. I also add "deferRender": true, The code I used as below:
var table = $('#shopDeliReport').dataTable({
'bJQueryUI': true,
'bProcessing': true,
'bServerSide': true,
'sAjaxSource':'reportsServerSide/shopDeli_stock/server_processing.php',
'sAjaxDataProp': 'aaData',
'bFilter': true,
'bRetrieve': true,
'sDom': 'lfrtipS',
'sPaginationType': 'full_numbers',
'bPaginate':true,
'bDeferRender': true,
"aLengthMenu": [[10, 25, 50, 100, 500, -1], [10, 25, 50, 100, 500, "All"]],
"fnRowCallback": function( nRow, aData, iDisplayIndex ) {
if ( jQuery.inArray(aData.DT_RowId, aSelected) !== -1 ) {
$(nRow).addClass('row_selected');
}
return nRow;
},
'fnServerData': function ( sSource, aoData, fnCallback) {
this.jqXHR = $.ajax( {
"dataType": 'json',
"type": "POST",
"url": sSource,
"data": aoData,
"success": fnCallback
} );
},
'aoColumns': [
{ "sClass": "center", "sName": "Date" },
{ "sClass": "left", "sName": "ShopName" },
{ "sClass": "left", "sName": "DressName" },
{ "sClass": "center", "sName": "SlipNo" },
{ "sClass": "center", "sName": "Qty" },
{ "sClass": "right", "sName": "Rate" },
{ "sClass": "right", "sName": "Dis" },
{ "sClass": "right", "sName": "Tot" },
{ "sClass": "center", "sName": "Des" }
]
}).columnFilter();
But still take more time any help?
This discussion has been closed.
Answers
Per the forum rules, can you link to a test case showing the issue please. Also, it would be worth checking that your server-side processing script is working correctly. Is it only returning 10 rows for each Ajax request? See the manual for details.
Allan
Thx, to replay Allan. I already solved it. This issu created by server-side script. Every thing is fine and also speed.