Quantcast
Channel: User motagirl2 - Stack Overflow
Viewing all articles
Browse latest Browse all 22

Answer by motagirl2 for DataTables do not send ajax request at the initialization

$
0
0

You should use "iDeferLoading" : 0 in DataTables parameters, when you initialize it:

var table =  $("#table").dataTable({"bProcessing": true,"bServerSide": true,"iDeferLoading": 0,"sAjaxSource": service_url,"sServerMethod": "POST",  ...  ...

(or "deferLoading":0 for newer DataTables versions, 1.10 and above),and then add the event to your button:

$("#button").on("click", function (event) {   $('#table').dataTable().fnDraw();});

https://datatables.net/examples/server_side/defer_loading.html


Viewing all articles
Browse latest Browse all 22

Trending Articles



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