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

Save aoData to the server side

$
0
0

Hi, thank you for such a great product. With regards to my question, I would like to extract aoData from datatables and save them on my server side to a json file. I do not need to load it back to the table directly. Followings is my code:

var table = $('#example').DataTable({ ajax: './d1/data.txt', paging: false, stateSave: true, stateSaveCallback: function (settings,data) { const state = JSON.stringify(settings.aoData); console.log(state); $.ajax( { "url": "./d1/index.html", "data": state, "type": "POST", "dataType":"json", "success": function () {} }); }, });

I do not if I am doing it right or wrong. I can see the aoData in the log but I do not know how to send it to my server. Many thanks.


Viewing all articles
Browse latest Browse all 82248

Trending Articles



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