Since DataTables 1.10.25 Fixed Columns causes loading the serverside data twice

Since DataTables 1.10.25 Fixed Columns causes loading the serverside data twice

Marcel Hoog AntinkMarcel Hoog Antink Posts: 9Questions: 3Answers: 0
edited July 2021 in DataTables 1.10

Hello,

Since DataTables 1.10.25 Fixed Columns causes loading the serverside data twice. In 1.10.24 it was OK.

Here is the link to the debug-info (https://debug.datatables.net/ozugel )
Has anyone any clue on this?

(I can try to reproduce it in JS-bin, but I want to ask first for any easy fix :) ...)

This question has accepted answers - jump to:

Answers

  • kthorngrenkthorngren Posts: 20,144Questions: 26Answers: 4,736
    edited July 2021 Answer ✓

    Interesting, I recreated the issue here:
    http://live.datatables.net/nepeqabo/1/edit

    You could use deferLoading to eliminate the first request until a fix is available. Uncomment //deferLoading: true, in the test case to see it in action.

    Kevin

  • colincolin Posts: 15,118Questions: 1Answers: 2,583

    Thanks for that test case, Kevin, that demonstrates it nicely!

    I've raised it internally (DD-2042 for my reference) and we'll report back here when there's an update.

    Cheers,

    Colin

  • Marcel Hoog AntinkMarcel Hoog Antink Posts: 9Questions: 3Answers: 0

    Hi Kevin, Colin,

    Thanks for the reply!!
    I'll try it on my site, and let you know!

  • Marcel Hoog AntinkMarcel Hoog Antink Posts: 9Questions: 3Answers: 0

    So I tried on my site:

    The basic work-around works, but on my site I have a different approach:
    Fixed Columns is default not set, then i read the data from the server and let DT fill the table. Then in fnInitComplete() I compare the scrollWidth with the dataWidth. If the scrollWidth greater than the dataWidth, I do a $.fn.dataTable.FixedColumns() to activate the Fixed Columns. With 'deferLoading' active, in this case data is not read from the server at all. ( reading the function of 'deferLoading' this seems logical)

    So thanks for the work-around, but I think I go back to 1.10.24 for the time being, waiting for the fix.

    Thank you !!

  • kthorngrenkthorngren Posts: 20,144Questions: 26Answers: 4,736
    Answer ✓

    Yep, deferLoading won't help in your case :smile:

    Kevin

Sign In or Register to comment.