server side request slow with 7 columns

server side request slow with 7 columns

15efer3r215efer3r2 Posts: 1Questions: 1Answers: 0

Hi,

So I just set up my datatable with server side loading. I followed the guide on here and all went well.

In the end I wanted to add a custom column to my table with data that did not come from the ajax call. I just added a null column to the table:

columns: [
{ data: 'col1' },
{ data: 'col2' },
{ data: 'col3' },
{ data: 'col4' },
{ data: 'col5' },
{ data: 'col6' },
{ data: null }
],

And then in the columnDefs I edited the column:

    {
        targets: -1,
        data: null,
        "render": function ( data, type, full, meta ) {
            return "<a href="">link</a>";
        }
    }

After adding my 7:th column the ajax loading time went from taking 20 - 40ms to 350-550ms, and I have not altered the ajax request in any way. If I remove the null-column it goes back to 20 - 40ms. I even tried to have 7 columns with only ajax data:

columns: [
{ data: 'col1' },
{ data: 'col2' },
{ data: 'col3' },
{ data: 'col4' },
{ data: 'col5' },
{ data: 'col6' },
{ data: 'col1'}
],

and still 350-550ms.I can even do this:

columns: [
{ data: 'col1' },
{ data: 'col2' },
{ data: 'col3' },
{ data: 'col4' },
{ data: 'col5' },
{ data: null }
],

and request times are in the 20 - 40ms range.

How does this make any sense?

Ty

Answers

  • colincolin Posts: 15,237Questions: 1Answers: 2,599

    That does seem a large jump, but it would depend on how many records you have. We're happy to take a look, but as per the forum rules, please link to a test case - a test case that replicates the issue will ensure you'll get a quick and accurate response. Information on how to create a test case (if you aren't able to link to the page you are working on) is available here.

    Cheers,

    Colin

This discussion has been closed.