Question about serverside draw parameter

Question about serverside draw parameter

kthorngrenkthorngren Posts: 21,445Questions: 26Answers: 4,974

I noticed that if the draw parameter is missing or set to 0 Datatables will draw the table. Its this code

        if ( draw ) {
            // Protect against out of sequence returns
            if ( draw*1 < settings.iDraw ) {
                return;
            }
            settings.iDraw = draw * 1;
        }

in _fnAjaxUpdateDraw that allows this. Just highlighting it in case that behavior is not intentional.

Kevin

Replies

  • allanallan Posts: 63,687Questions: 1Answers: 10,500 Site admin

    Hi Kevin,

    Thanks - its a bit of legacy support that. The draw parameter is optional (in fact, I only added it when our unit tests were failing because of out of sequence returns from the server).

    That said, it should really be checking for draw being undefined rather than falsy. I've just committed that change. Thanks for highlighting this!

    Allan

This discussion has been closed.