Refresh Datatable

Refresh Datatable

TsokotsaTsokotsa Posts: 7Questions: 2Answers: 0

Hi There

I would like to refresh DT after i add a new record. I display the data using the following code:

Category Description Due <?php foreach ($todo as $todos) { ?> <?php } ?>
<?= $todos['todo_category'] ?> <?= $todos['todo_description'] ?> <?= $todos['todo_date'] ?>

and i initialise the DT with $("#todo").DataTable();

Everything works fine, however when i create a new Line i post the data using ajax and on success, i would like to to something like $("#todo").DataTable().ajax.reload();
That works on other code wher i pull data from the server side but on that on i get an error TypeError: g is null

can someone please help on how to i draw that inserted line.

This discussion has been closed.