HTML5 data attribute for sAjaxSource
HTML5 data attribute for sAjaxSource
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
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
This discussion has been closed.
Replies
Allan