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

HTML5 data attribute for sAjaxSource

$
0
0
Hi everybody,

I like to pass a data attribute as ajaxSource, because I'm using dynamic tables.
I tried something like

$('.datatable table').dataTable({
"sAjaxSource": "/api/" + $(this).data('source')
});

but I get the string unknown for $(this).data('source').
When I add

"fnInitComplete": function () {
console.log($(this).data('source'));
}

the attribute is shown correctly.

Do you have any idea how to solve this?


Thanks and regards,
bart

Viewing all articles
Browse latest Browse all 82226

Trending Articles



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