In this tutorial, we will discuss how to fix the error, Datatables warning(table id = ‘example’): cannot reinitialise data table.
Datatables warning(table id = ‘example’): cannot reinitialise data table
The error came while I was trying to retrieve more than 5000 items using Rest API from a SharePoint Online list and was trying to bind the data to DataTables.
Here, I was using the code below:
$('#Employee').DataTable({
"aaData": response,
"aoColumns": [
{
"mData": "Title"
}
]
});
But it gave the error when I tried to execute the code. It gave error as:
DataTables warning: table id=Employee – Cannot reinitialise DataTable. For more information about this error, please see http://datatables.net/tn/3

To fix the error, you need to add the below attribute.
"bDestroy": true
It will look like below:
$('#Employee').DataTable({
"aaData": response,
"bDestroy": true,
"aoColumns": [
{
"mData": "Title"
}
]
});
After this, the error did not come; this fixes the issue Datatables warning(table id = ‘example’): cannot reinitialise data table.
I hope this solution will help you to fix the error, datatables warning: table id=example – cannot reinitialise datatable. for more information about this error.
You may also like:
- if the option “save a list as template” is missing on the list settings. it is most probably because
- Your organization needs more information to keep your account secure
- Server relative URLs must start with spweb.serverrelativeurl in SharePoint
- http error 400. the size of the request headers is too long
- Error=Value=QuotaExceeded in SharePoint

Hey! I’m Bijay Kumar, founder of SPGuides.com and a Microsoft Business Applications MVP (Power Automate, Power Apps). I launched this site in 2020 because I truly enjoy working with SharePoint, Power Platform, and SharePoint Framework (SPFx), and wanted to share that passion through step-by-step tutorials, guides, and training videos. My mission is to help you learn these technologies so you can utilize SharePoint, enhance productivity, and potentially build business solutions along the way.