cannot use any ajax functions on datatable table
cannot use any ajax functions on datatable table
![themate0](https://secure.gravatar.com/avatar/dd6f8d762ada2f23af0bc0b745ccac30/?default=https%3A%2F%2Fvanillicon.com%2Fdd6f8d762ada2f23af0bc0b745ccac30_200.png&rating=g&size=120)
Hi, I did follow this doc refference https://datatables.net/reference/api/ajax.reload() but I am still getting error with ajax instance.
$(function () {
var tt = $('#users-table').DataTable({
serverSide: true,
processing: true,
ajax: '/panel/uzytkownicy/data',
columns: [
// my columns
]
});
setInterval( function () {
tt.ajax.reload();
}, 1000 );
});
This is the way how I add DataTable to my project (i am using npm)
window.$.fn.DataTable = require( 'datatables.net-bs4' );
Error is: TypeError: tt.ajax is undefined
DataTables are working perfectly, I can sort, search etc. etc. but im facing problem with ajax api.
Am i importing datatables in wrong way and it is not recognizing api instance in js or what?
Replies
looks like i was importing it in wrong way
i fixed it and topic can be deleted.