How to refresh/reload dataTable?
How to refresh/reload dataTable?
pravink
Posts: 16Questions: 0Answers: 0
Hello,
I want to reload/refresh the data in dataTable after I click on refresh button.
Currently I am calling the dataTable intialisation function on button click but that's sending the ajax request again and again.
Is there any other way to reload/refresh the dataTable?
Please help, I need this on urgent basis.
I want to reload/refresh the data in dataTable after I click on refresh button.
Currently I am calling the dataTable intialisation function on button click but that's sending the ajax request again and again.
Is there any other way to reload/refresh the dataTable?
Please help, I need this on urgent basis.
This discussion has been closed.
Replies
This is an example of how I do it in many places. This method recreates a datatable.
[code]
var initializeDataTable = function($this, settings) {
// destroy the existing datatable
if (settings.$dataTable != undefined) {
settings.$dataTable = settings.$dataTable..dataTable({ "bDestroy": true });
}
// empty the container that wraps the html table
settings.$dataTableContainer.html("");
// TODO: append a new html table to the table container
// create new datatable
settings.$dataTable = settings.$dataTableContainer.children().first().dataTable(settings.dataTableOptions);
};
[/code]
Is there any other way to do this? I mean can't we refresh the dataTable without re-initialising it?