drawcallback with setTimeout datatables 1.10.5

drawcallback with setTimeout datatables 1.10.5

jemzjemz Posts: 131Questions: 40Answers: 1
edited March 2015 in Free community support

hi, is it okay to put setTimeout in the callback ?

like this.

  "drawCallback": function( settings ) {
            setTimeout(function(){
                mytable.ajax.reload();

            },5000);

        }

because i want to reload my table in every 5 seconds.

Thank you in advance.

Answers

  • allanallan Posts: 63,678Questions: 1Answers: 10,497 Site admin
    edited March 2015

    I don't see why not, although as I noted in your github issue I would suggest setInterval instead.

    Allan

  • jemzjemz Posts: 131Questions: 40Answers: 1

    Hi @allan thank you for the quick reply...yes I change it to setInterval but I remove it in the drawcallback: because when I look at in the firebug it will request two 2 times.

This discussion has been closed.