How to reload DOM datatable ?
How to reload DOM datatable ?
denver
Posts: 3Questions: 1Answers: 0
I am using Dom datatable. I want to add
paging: false,
initComplete: function() {
let api = this.api();
setInterval(function() {
api.ajax.reload();
}, 1000);
},
I added codes. But I am getting popup error. Reload is not working.
Codepen Preview : https://codepen.io/themecode/pen/dyevdEy
Please help me
Answers
You aren't using
ajax
to load data for the table, soajax.reload()
isn't going to do anything to help you!How are you getting the new data for your DataTable? If it is DOM sourced then you need to use the DataTables API to update the DataTable.
Allan
ohh . I am not a developer. I dont know Jquery , Ajax.. Sorry.. Thanks for your reply
Anyways, have any option for setInterval(function and reload DOM datatable ?
Datatables doesn't have any built in methods to reload DOM sourced table.
The first question to answer is the one Allan had:
Deepening on how you are doing this will determine what Datatables methods need to be used. Start by telling us how will fetch the updated table data.
Kevin