Table takes so long when loading(about 5,000 rows)

Table takes so long when loading(about 5,000 rows)

hyi18hyi18 Posts: 2Questions: 1Answers: 0

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

  • allanallan Posts: 63,550Questions: 1Answers: 10,476 Site admin
    Answer ✓

    Happy to take a look at a page showing the issue.

    Thanks,
    Allan

  • hyi18hyi18 Posts: 2Questions: 1Answers: 0

    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 :)

This discussion has been closed.