Quantcast
Channel: Recent Discussions — DataTables forums
Viewing all articles
Browse latest Browse all 82293

Send data when using .draw() ?

$
0
0

Hi,

I'm manually setting some data with ajax:data it works if trigger .draw() using column filtering :

dtTableAPI.columns("e.etat:name").search(val_etat);
dtTableAPI.draw();

but it don't work when I try do .draw or ajax.reload in the initComplete.

With console.log I saw :

  • ajax.data.function is called but dateDebut and dateFin are null

  • initComplete is called but neither .draw or .ajax.reload() is triggering ajax.data.function

do I miss somehing ?

table.dataTable({
    ajax: {
        url: myurl
            data: function (d) {
                d.dateDebut = dateDebut;
                d.dateFin = dateFin;
            }
    }
...
    initComplete: function (settings, json) {
        dtTableAPI = $("#table").DataTable();
        dateDebut = "01/01/2016";
        dateFin = "31/01/2016";
        dtTableAPI.draw();
        dtTableAPI.ajax.reload();
    }
...

I hope my explanations are clear enough.

ps : The code is working (don't mind if there is typo or whatever, I summarized it).


Viewing all articles
Browse latest Browse all 82293

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>