Table takes so long when loading(about 5,000 rows)
Table takes so long when loading(about 5,000 rows)
Hi,
I'm new to DataTables and I found it is amazing! Everything is perfect when I'm rendering only less than 200 rows... However when I'm rendering about 5,000 rows it takes a long time to load. On Chrome it takes more than 5 minutes. I'm using client side processing with data sourced from AJAX. Here is my table's configuration:
$('#myTable').DataTable({
deferRender: true,
scrollY: 200,
scrollCollapse: true,
scroller: true,
stateSave: true,
ajax: {
url: '/UserAdmin/AjaxJsonResult',
dataSrc: ''
},
columnDefs: [
{
"targets": [6], "data": "Id", "render": function(data, type, row, meta) {
return '@Html.ActionLink("Manage", "Edit", new {id = "replace"}) | '.replace("replace", data) + '@Html.ActionLink("Reset Password", "ResetPassword", new {id="replace"}, new { @class="reset-password-link"})'.replace("replace", data);
}
}
],
columns: [
{ data: 'DisplayName' },
{ data: 'Email' },
{ data: 'MobileNumber' },
{ data: 'WorkNumber' },
{ data: 'OrganisationName' },
{ data: 'SelectedRoadNetworkName' }
]
});
I also felt the deferRender setting is not working somehow...Another thing I notice is the AJAX request takes quite a long time to get data back, I'm wondering if that's the cause, or am I missing parameters for the ajax clause?
Thanks
This question has an accepted answers - jump to answer
Answers
Happy to take a look at a page showing the issue.
Thanks,
Allan
Thanks Allen,
I found out that the table is working fine, it's the local server that slows things down, once I switch to a cloud server everything is perfect