Datatables missing columns after ajax.reload

Datatables missing columns after ajax.reload

tomdecosteretomdecostere Posts: 2Questions: 1Answers: 0

Hello,

We have created a dispatch application (asp mvc backend) that contains a page with a large datatable, displaying the latest missions.

This datatable has an autorefresh function, that triggers the following datatables method:

function createInterventionDatatable() {

    // initialize the datatable
    var interventionDataTable = $('#InterventionFicheList');
    var settings = getRemoteDatatableSettings(interventionDataTable);

    // create the datatable
    remoteDatatable = interventionDataTable.dataTable(settings);
}

function autoRefresh() {
    remoteDatatable.api().ajax.reload(null, false);
}

This works flawslessly for a few minutes, but suddenly the ajax calls that are being sent towards the server are missing columns.

See the screenshots below for the actual data that is being sent towards the server.

Normal call:

Unwanted/Abnormal call:

As you can see there are a lot of columns missing in the GET request of the last ajax call.

This results in a totally wrong rendered table and this keeps on happening until the backend returns an updated version of the list (when a new mission has been created).

Is this some kind of caching?
Anybody knows why this is happening and how to counter this?

Answers

  • kthorngrenkthorngren Posts: 20,302Questions: 26Answers: 4,769
    edited May 2019

    Are you using server side processing? Looks like you are with an old version of Datatables (1.9).

    The screenshots are the response from your server. The place to start is to look at the server script to determine why it is sending back the reduced set of columns. If using Server Side processing, click on the Header tab to see the parameters being sent to the server. Do those look correct?

    This results in a totally wrong rendered table and this keeps on happening until the backend returns an updated version of the list (when a new mission has been created).

    Are you saying columns are missing or some of the data in the columns are missing? The number of columns shouldn't change just by using ajax.reload().

    Kevin

  • tomdecosteretomdecostere Posts: 2Questions: 1Answers: 0

    Thank you for the pointer.

    I'll check server side what is happening, since this only occurs after some minutes.
    So my guess will be loss of session data that is used when rendering the table data.

    I'll comment back when I know more.

This discussion has been closed.