Large amount of data could not be bound in datatable

Large amount of data could not be bound in datatable

nayanhodarnayanhodar Posts: 1Questions: 0Answers: 0
edited February 2016 in Free community support

Hi all,

i am facing problem while i am binding large data let say >300000 rows in datatable.

it takes too much time to load data but not giving result.

it takes 5 to 7 second to bind 1000 records.

how can i speed up my execution.

Please help for this issue.

here is my code.

this.GetTransferFiles = function () {

    table = $('#example1').DataTable({
        "order": [[0, "desc"]],
        "deferRender": true,                    
        ajax: {
            url: '/Dashboard/GetFileHistory',                                              <----- to get json data
            dataSrc: function (json) {
                $('#TotalFiles').text(json.data.length);                   
                return json.data;
            }
        },
        "lengthMenu": [[10, 25, 50, 100, -1], [10, 25, 50, 100, "All"]],
        "language": {
            "loadingRecords": $('#Loadmsg').val(),
            "emptyTable": $('#lblNoRecords').val(),
            "lengthMenu": $('#lbldisplay').val() + " _MENU_ " + $('#lblrecordsperpage').val(),
            "zeroRecords": $('#lblNoRecords').val(),
            "info": $('#lblShowingpage').val() + " _PAGE_ " + $('#lblof').val() + " _PAGES_ ",
            "infoEmpty": $('#lblNoRecords').val(),
            "infoFiltered": $('#lblFiltermsg1').val() + " _MAX_ " + $('#lblFiltermsg2').val(),
            "paginate": {
                "next": $('#btnNext').val(),
                "previous": $('#btnPrevious').val(),
            },
        },
        "columns": [
              { "width": "5%" },
              { "width": "25%" },
              { "width": "20%" },
              { "width": "20%" },
              { "width": "20%" },
              { "width": "7%" },
              { "width": "3%" },
        ],
        columnDefs: [{
            targets: -1,
            data: null,
            defaultContent: "<i class='fa fa-download' style='cursor:pointer'></i>"
        },
         { type: 'date-euro', targets: 4 },
        {
            targets: 0,
            "visible": false,
            "searchable": false
        }],
    });

    $('#example1 tbody').on('click', 'i', function () {
        var data = table.row($(this).parents('tr')).data();
        window.open(data[6], '_blank');
    });

}
This discussion has been closed.