I\'m working on a page that uses jquery DataTables (version 1.10). The TableData source is currently being sent as just an HTML table on the rendered page, and works perfect. Ho
Whoever ends up here. I know this question has already an accepted answer, but it didn't work for me. What worked for me: I used exact example from here: https://datatables.net/examples/api/row_details.html Only thing I changed is
$(document).ready(function() {
var table = $('#example').DataTable( {
"ajax": "../ajax/data/objects.txt", <-- this line I changed
To
$(document).ready(function() {
var table = $('#example').DataTable( {
"data": <%-JSON.stringify(data.table)%>,
I used ejs so I sent data from server-side and in html I could use <%= data %>, which had the table, but in html script I had to use data.table like this:
<%-JSON.stringify(data.table)%>