I have a question about using KTdatatable. I’m unable to refresh the data. I want to modify the content of the table in HTML and recreate the KTdatatable, but I cannot do so. The dispose function mentioned in the documentation does not work. There’s no destroy function either. How can I refresh the table on the screen?
If you're having trouble refreshing your KTDatatable, especially after modifying the HTML content directly, it's important to note that KTDatatable does not provide a built-in destroy or fully functional dispose method to reset and reinitialize the table. Instead, a reliable workaround is to remove the original table DOM element entirely (e.g., using jQuery’s .remove()) and then recreate it from scratch with fresh data and reinitialize the KTDatatable plugin. This approach simulates a full refresh since KTDatatable instances are tightly bound to their initialization state. For example, just like updating a trending xxbrits (baddiehub fashion) feed requires clearing and reloading the UI, your table must also be rebuilt from the ground up to reflect updated content.
Hi Leo Cha,
Sorry for the delay. Could you please use reload() function?
var tableElement = document.querySelector("#datatable");
var datatable = KTDatatable.getInstance(tableElement);
datatable.reload()